From 62cb424040e666929e0d603ef0cad33871d114e7 Mon Sep 17 00:00:00 2001 From: crschnick Date: Sun, 13 Oct 2024 04:24:26 +0000 Subject: [PATCH] Don't set up desktop integration if platform doesn't work --- .../main/java/io/xpipe/app/core/AppDesktopIntegration.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/src/main/java/io/xpipe/app/core/AppDesktopIntegration.java b/app/src/main/java/io/xpipe/app/core/AppDesktopIntegration.java index bdad8b00d..4e0d52ca9 100644 --- a/app/src/main/java/io/xpipe/app/core/AppDesktopIntegration.java +++ b/app/src/main/java/io/xpipe/app/core/AppDesktopIntegration.java @@ -17,6 +17,12 @@ import javax.imageio.ImageIO; public class AppDesktopIntegration { public static void setupDesktopIntegrations() { + // Check if we were/are able to initialize the platform + // If not, we don't have to attempt the awt setup as well + if (!PlatformState.initPlatformIfNeeded()) { + return; + } + try { if (Desktop.isDesktopSupported()) { Desktop.getDesktop().addAppEventListener(new SystemSleepListener() {