From 0c4b499c3310aaf412e0ad0eb0200b351d0190fe Mon Sep 17 00:00:00 2001 From: weisj Date: Sun, 8 Mar 2020 19:17:11 +0100 Subject: [PATCH] Don't uninstall decorations if window handle is 0 on windows. --- .../weisj/darklaf/platform/windows/ui/WindowsTitlePane.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/windows/src/main/java/com/github/weisj/darklaf/platform/windows/ui/WindowsTitlePane.java b/windows/src/main/java/com/github/weisj/darklaf/platform/windows/ui/WindowsTitlePane.java index 00f505c1..e71d956c 100644 --- a/windows/src/main/java/com/github/weisj/darklaf/platform/windows/ui/WindowsTitlePane.java +++ b/windows/src/main/java/com/github/weisj/darklaf/platform/windows/ui/WindowsTitlePane.java @@ -188,8 +188,10 @@ public class WindowsTitlePane extends CustomTitlePane { protected void uninstallDecorations() { window = null; - JNIDecorationsWindows.uninstallDecorations(windowHandle); - windowHandle = 0; + if (windowHandle != 0) { + JNIDecorationsWindows.uninstallDecorations(windowHandle); + windowHandle = 0; + } rootPane.removeContainerListener(rootPaneContainerListener); rootPane.getLayeredPane().removeContainerListener(layeredPaneContainerListener); if (menuBar != null) {