Don't set up desktop integration if platform doesn't work

This commit is contained in:
crschnick 2024-10-13 04:24:26 +00:00
parent 9dc5cf8048
commit 62cb424040

View file

@ -17,6 +17,12 @@ import javax.imageio.ImageIO;
public class AppDesktopIntegration { public class AppDesktopIntegration {
public static void setupDesktopIntegrations() { 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 { try {
if (Desktop.isDesktopSupported()) { if (Desktop.isDesktopSupported()) {
Desktop.getDesktop().addAppEventListener(new SystemSleepListener() { Desktop.getDesktop().addAppEventListener(new SystemSleepListener() {