Apply suggestions from code review

This commit is contained in:
delvh 2020-07-04 16:07:10 +02:00
parent b597dec63a
commit d8b0e335f3
1 changed files with 2 additions and 4 deletions

View File

@ -149,10 +149,8 @@ public final class SceneContext {
stage.sizeToScene();
// If the controller implements the Restorable interface,
// the actions to perform on restoration will be executed here
try {
final Restorable restorable = (Restorable) controllerStack.peek();
restorable.onRestore();
} catch (final ClassCastException e) {}
final var controller = controllerStack.peek();
if (controller instanceof Restorable) ((Restorable) controller).onRestore();
}
stage.show();
}