The NPE occurs when the skinnable is removed from the scene while the popup is showing. The MenuButtonSkinBase, when popup becomes hidden, tries to remove Mnemonics from the scene and runs into NPE. To avoid NPE a null-check is added to the 'showing' listener.
Since the mnemonics cannot be removed from the scene in standard way, when popup becomes hidden. They are now also removed from the scene, when the skinnable is removed from it. ------------- Commit messages: - 8244234: MenuButton: NPE on removing from scene with open popup Changes: https://git.openjdk.java.net/jfx/pull/713/files Webrev: https://webrevs.openjdk.java.net/?repo=jfx&pr=713&range=00 Issue: https://bugs.openjdk.java.net/browse/JDK-8244234 Stats: 116 lines in 2 files changed: 101 ins; 1 del; 14 mod Patch: https://git.openjdk.java.net/jfx/pull/713.diff Fetch: git fetch https://git.openjdk.java.net/jfx pull/713/head:pull/713 PR: https://git.openjdk.java.net/jfx/pull/713