From 7235e8d60d7eeabad67b1cf71d90615ab9601c64 Mon Sep 17 00:00:00 2001
From: tobias <thinkdifferent055@gmail.com>
Date: Wed, 24 Jul 2024 18:58:40 +0200
Subject: [PATCH] Fix null pointer exception

---
 .../settings/ContentPlayerSettingsViewController.scala | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/PlayWallPlugins/PlayWallPluginContentPlayer/src/main/scala/de/tobias/playpad/plugin/content/settings/ContentPlayerSettingsViewController.scala b/PlayWallPlugins/PlayWallPluginContentPlayer/src/main/scala/de/tobias/playpad/plugin/content/settings/ContentPlayerSettingsViewController.scala
index 232afcb4..f76e44fb 100644
--- a/PlayWallPlugins/PlayWallPluginContentPlayer/src/main/scala/de/tobias/playpad/plugin/content/settings/ContentPlayerSettingsViewController.scala
+++ b/PlayWallPlugins/PlayWallPluginContentPlayer/src/main/scala/de/tobias/playpad/plugin/content/settings/ContentPlayerSettingsViewController.scala
@@ -157,15 +157,15 @@ class ContentPlayerSettingsViewController extends ProfileSettingsTabViewControll
 	override def loadSettings(settings: Profile): Unit = {
 		val configuration = ContentPlayerSettingsViewController.getZoneConfiguration
 		startZoneHash = configuration.zones.hashCode
-		startScreenHash = configuration.screen.hashCode
+		startScreenHash = if (configuration.screen != null) configuration.screen.hashCode else 0
 
 		listView.getItems.setAll(configuration.zones)
 
 		val screens = ContentPlayerWindow.GetScreens
 		val selectedScreen = configuration.screen
 		screenComboBox.getSelectionModel.select(new SelectableContentScreen(screens
-		  .find(screen => screen.getName == selectedScreen)
-		  .getOrElse(screens.head)))
+			.find(screen => screen.getName == selectedScreen)
+			.getOrElse(screens.head)))
 
 		ffmpegTextField.setText(configuration.ffmpegExecutable)
 		ffprobeTextField.setText(configuration.ffprobeExecutable)
@@ -188,8 +188,8 @@ class ContentPlayerSettingsViewController extends ProfileSettingsTabViewControll
 	}
 
 	override def needReload(): Boolean = startZoneHash != ContentPlayerSettingsViewController.getZoneConfiguration.zones.hashCode ||
-	  startScreenHash != ContentPlayerSettingsViewController.getZoneConfiguration.screen.hashCode ||
-	  !listView.getSelectionModel.isEmpty
+		startScreenHash != ContentPlayerSettingsViewController.getZoneConfiguration.screen.hashCode ||
+		!listView.getSelectionModel.isEmpty
 
 	override def validSettings(): Boolean = {
 		true
-- 
GitLab