From 396eec02d981b7f09badb2308b2ee062697ee417 Mon Sep 17 00:00:00 2001
From: tobias <tobias@thecodedev.de>
Date: Sun, 29 Sep 2019 21:42:28 +0200
Subject: [PATCH] Fix key shortcut null display issue

---
 .../viewcontroller/main/MenuToolbarViewController.java     | 2 +-
 .../playout/viewcontroller/MainViewControllerListener.java | 7 ++++++-
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/PlayWallCore/src/main/java/de/tobias/playpad/viewcontroller/main/MenuToolbarViewController.java b/PlayWallCore/src/main/java/de/tobias/playpad/viewcontroller/main/MenuToolbarViewController.java
index 53e53c75..bc6a2257 100644
--- a/PlayWallCore/src/main/java/de/tobias/playpad/viewcontroller/main/MenuToolbarViewController.java
+++ b/PlayWallCore/src/main/java/de/tobias/playpad/viewcontroller/main/MenuToolbarViewController.java
@@ -152,7 +152,7 @@ public abstract class MenuToolbarViewController extends NVC {
 	public abstract void loadKeybinding(KeyCollection keys);
 
 	public void setKeyBindingForMenu(MenuItem menuItem, Key key) {
-		if (key != null && !key.getKeyCode().isEmpty()) {
+		if (key != null && key.getKey() != null && !key.getKeyCode().isEmpty()) {
 			KeyCombination keyCode = KeyCombination.valueOf(key.getKeyCode());
 			menuItem.setAccelerator(keyCode);
 		}
diff --git a/PlayWallPlugins/PlayWallPluginPlayoutLog/src/main/java/de/tobias/playpad/plugin/playout/viewcontroller/MainViewControllerListener.java b/PlayWallPlugins/PlayWallPluginPlayoutLog/src/main/java/de/tobias/playpad/plugin/playout/viewcontroller/MainViewControllerListener.java
index 25925457..58ad0c82 100644
--- a/PlayWallPlugins/PlayWallPluginPlayoutLog/src/main/java/de/tobias/playpad/plugin/playout/viewcontroller/MainViewControllerListener.java
+++ b/PlayWallPlugins/PlayWallPluginPlayoutLog/src/main/java/de/tobias/playpad/plugin/playout/viewcontroller/MainViewControllerListener.java
@@ -6,6 +6,7 @@ import de.tobias.playpad.PlayPadPlugin;
 import de.tobias.playpad.plugin.MainWindowListener;
 import de.tobias.playpad.plugin.playout.PlayoutLogPlugin;
 import de.tobias.playpad.plugin.playout.Strings;
+import de.tobias.playpad.settings.keys.Key;
 import de.tobias.playpad.settings.keys.KeyCollection;
 import de.tobias.playpad.view.main.MenuType;
 import de.tobias.playpad.viewcontroller.main.IMainViewController;
@@ -39,7 +40,11 @@ public class MainViewControllerListener implements MainWindowListener {
 	public void loadMenuKeyBinding() {
 		final KeyCollection keyCollection = PlayPadPlugin.getInstance().getGlobalSettings().getKeyCollection();
 		final MenuToolbarViewController menuToolbarController = PlayPadPlugin.getInstance().getMainViewController().getMenuToolbarController();
-		menuToolbarController.setKeyBindingForMenu(menuItem, keyCollection.getKey(PlayoutLogPlugin.KEY_COLLECTION_PLAYOUT));
+
+		final Key key = keyCollection.getKey(PlayoutLogPlugin.KEY_COLLECTION_PLAYOUT);
+		if (key != null) {
+			menuToolbarController.setKeyBindingForMenu(menuItem, key);
+		}
 
 		menuItem.setDisable(false);
 	}
-- 
GitLab