Update properties on wrapper creation, fix NPE
All checks were successful
zdm/undo-redo/pipeline/head This commit looks good

This commit is contained in:
Kai S. K. Engelbart 2021-12-25 21:57:25 +02:00
parent 4a70d954ef
commit 7101523584
Signed by: kske
GPG Key ID: 8BEB13EC5DF7EF13
2 changed files with 2 additions and 1 deletions

View File

@ -47,6 +47,7 @@ public class ChangeManagerWrapper<C extends Change, M extends ChangeManager<C>>
*/
public ChangeManagerWrapper(M manager) {
this.manager = manager;
updateProperties();
}
@Override

View File

@ -21,7 +21,7 @@ public interface ObservableChangeManager<C extends Change> extends ChangeManager
@Override
default Optional<C> getLastChange() {
return Optional.of(lastChangeProperty().get());
return Optional.ofNullable(lastChangeProperty().get());
}
ReadOnlyBooleanProperty atMarkedChangeProperty();