[Fix] Fixed NPE in ExecutionPolicy.handleStopped()

This commit is contained in:
Robert von Burg 2023-12-06 12:24:25 +01:00
parent 0d674cf947
commit 974c3955ee
Signed by: eitch
GPG Key ID: 75DB9C85C74331F7
1 changed files with 8 additions and 7 deletions

View File

@ -250,7 +250,8 @@ public abstract class ExecutionPolicy extends StrolchPolicy {
* Performs tasked required when this execution policy is stopped
*/
protected void handleStopped() {
getDelayedExecutionTimer().cancel(this.actionLoc);
if (this.actionLoc != null)
getDelayedExecutionTimer().cancel(this.actionLoc);
}
/**
@ -262,12 +263,12 @@ public abstract class ExecutionPolicy extends StrolchPolicy {
*/
protected void setActionState(Action action, State state) {
if (action.getState().inClosedPhase())
throw new IllegalStateException("Action " +
action.getLocator() +
" has state " +
action.getState() +
" and can not be changed to " +
state);
throw new IllegalStateException("Action "
+ action.getLocator()
+ " has state "
+ action.getState()
+ " and can not be changed to "
+ state);
action.setState(state);