Fix minor error when popping the last scene
This commit is contained in:
		| @@ -13,6 +13,10 @@ import envoy.client.event.ThemeChangeEvent; | ||||
| import envoy.event.EventBus; | ||||
|  | ||||
| /** | ||||
|  * Manages a stack of scenes. The most recently added scene is displayed inside | ||||
|  * a stage. When a scene is removed from the stack, its predecessor is | ||||
|  * displayed.<br> | ||||
|  * <br> | ||||
|  * Project: <strong>envoy-client</strong><br> | ||||
|  * File: <strong>SceneContext.java</strong><br> | ||||
|  * Created: <strong>06.06.2020</strong><br> | ||||
| @@ -75,8 +79,10 @@ public final class SceneContext { | ||||
| 	 */ | ||||
| 	public void pop() { | ||||
| 		sceneStack.pop(); | ||||
| 		stage.setScene(sceneStack.peek()); | ||||
| 		applyCSS(); | ||||
| 		if (!sceneStack.isEmpty()) { | ||||
| 			stage.setScene(sceneStack.peek()); | ||||
| 			applyCSS(); | ||||
| 		} | ||||
| 		stage.show(); | ||||
| 	} | ||||
|  | ||||
|   | ||||
| @@ -123,6 +123,7 @@ public final class Startup extends Application { | ||||
| 		final var sceneContext = new SceneContext(stage); | ||||
| 		sceneContext.load(SceneContext.SceneInfo.CHAT_SCENE); | ||||
| 		sceneContext.<ChatSceneController>getController().initializeData(sceneContext, localDB, client, writeProxy); | ||||
|  | ||||
| 		stage.setTitle("Envoy"); | ||||
| 		stage.setMinHeight(400); | ||||
| 		stage.setMinWidth(350); | ||||
| @@ -137,7 +138,7 @@ public final class Startup extends Application { | ||||
| 	 * {@inheritDoc} | ||||
| 	 */ | ||||
| 	@Override | ||||
| 	public void stop() throws Exception { | ||||
| 	public void stop() { | ||||
| 		try { | ||||
| 			// Save Settings and PersistentLocalDB on shutdown | ||||
| 			logger.info("Closing connection..."); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user