Skip to content

Commit

Permalink
Small fix for LinkedActionRunner
Browse files Browse the repository at this point in the history
  • Loading branch information
retrodaredevil committed Jul 28, 2020
1 parent 12385cb commit 3379f11
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/main/java/me/retrodaredevil/action/Actions.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
import java.io.PrintWriter;
import java.util.*;

import static java.util.Objects.requireNonNull;

public final class Actions {
private Actions(){ throw new UnsupportedOperationException(); }

Expand Down Expand Up @@ -46,7 +48,7 @@ public static Action createRunOnceRecyclableRunOnce(Runnable runnable){
return new RunOnceAction(runnable, RunOnceAction.RunType.RUN_ONCE);
}
public static Action createRunOnce(Action action){
Objects.requireNonNull(action);
requireNonNull(action);
return createRunOnce(createRunOnceRunnable(action));
}
public static Action createRunOnceRecyclable(Action action){
Expand All @@ -56,7 +58,7 @@ public static Action createRunOnceRecyclableRunOnce(Action action){
return createRunOnceRecyclableRunOnce(createRunOnceRunnable(action));
}
private static Runnable createRunOnceRunnable(Action action){
Objects.requireNonNull(action);
requireNonNull(action);
return () -> {
action.update();
action.end();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ private void updateAction(){
action = nextAction;
if(immediatelyDoNextWhenDone){
updateAction();
return;
}
}
}
Expand Down

0 comments on commit 3379f11

Please sign in to comment.