Add safe error catching

This commit is contained in:
mcrcortex committed 2024-11-16 16:29:57 +10:00
1 parent c9c7d9ab1b
commit f1b43d69b6
1 file changed
+8 -1
@@ -1,5 +1,7 @@
package com.moulberry.flashback.exporting.taskbar;
import com.moulberry.flashback.Flashback;
import com.replaymod.lib.com.googlecode.mp4parser.util.Logger;
import com.sun.jna.Pointer;
import com.sun.jna.platform.win32.*;
import com.sun.jna.ptr.PointerByReference;
@@ -11,7 +13,12 @@ import static com.moulberry.flashback.editor.ui.CustomImGuiImplGlfw.IS_WINDOWS;
public class TaskbarHost {
public static ITaskbar createTaskbar() {
if (IS_WINDOWS) {
return createWindowsInterface();
try {
return createWindowsInterface();
} catch (Exception e) {
Flashback.LOGGER.error("Unable to create windows taskbar interface", e);
return new NoopTaskbar();
}
} else {
return new NoopTaskbar();
}