Skip to content

Commit e145417

Browse files
authored
Merge pull request #103 from UCSDOalads/addRedobyDYB
Add "if" check for delegate
2 parents 4a84caa + 584bfe2 commit e145417

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

src/actions/edit/undoredo/SharedUndoRedoActionManager.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,9 @@ public void undo() {
3333
UndoRedoableInterface undoableAction = undoStack.pop();
3434
undoableAction.undoAction();
3535
redoStack.add(undoableAction);
36-
delegate.didUndoAction(undoableAction);
36+
if (delegate != null) {
37+
delegate.didUndoAction(undoableAction);
38+
}
3739
}
3840
else {
3941
System.out.println("empty undo stack");
@@ -45,7 +47,9 @@ public void redo() {
4547
UndoRedoableInterface redoableAction = redoStack.pop();
4648
redoableAction.redoAction();
4749
undoStack.add(redoableAction);
48-
delegate.didRedoAction(redoableAction);
50+
if (delegate != null) {
51+
delegate.didRedoAction(redoableAction);
52+
}
4953
}
5054
else {
5155
System.out.println("empty redo stack");

0 commit comments

Comments
 (0)