From 3dd2fba82c809b8247278fb2e830da53b1230409 Mon Sep 17 00:00:00 2001 From: ev chang Date: Wed, 13 Nov 2024 11:01:03 -0500 Subject: [PATCH] make try catch in audio switcher catch throwable instead of exception --- .../patcher/util/world/sound/audioswitcher/ALCHelper.java | 4 ++-- .../world/sound/audioswitcher/LibraryLWJGLOpenALImpl.java | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/club/sk1er/patcher/util/world/sound/audioswitcher/ALCHelper.java b/src/main/java/club/sk1er/patcher/util/world/sound/audioswitcher/ALCHelper.java index 0dc8671d6..eb980b513 100644 --- a/src/main/java/club/sk1er/patcher/util/world/sound/audioswitcher/ALCHelper.java +++ b/src/main/java/club/sk1er/patcher/util/world/sound/audioswitcher/ALCHelper.java @@ -31,10 +31,10 @@ public List getAvailableDevices(boolean useCache) { private String[] getAvailableDevicesString() { try { return ALC10.alcGetString(null, ALC11.ALC_ALL_DEVICES_SPECIFIER).split("\0"); - } catch (Exception ignored) { + } catch (Throwable ignored) { try { return ALC10.alcGetString(null, ALC10.ALC_DEVICE_SPECIFIER).split("\0"); - } catch (Exception ignored2) { + } catch (Throwable ignored2) { return null; } } diff --git a/src/main/java/club/sk1er/patcher/util/world/sound/audioswitcher/LibraryLWJGLOpenALImpl.java b/src/main/java/club/sk1er/patcher/util/world/sound/audioswitcher/LibraryLWJGLOpenALImpl.java index 149d50fd1..909de9d87 100644 --- a/src/main/java/club/sk1er/patcher/util/world/sound/audioswitcher/LibraryLWJGLOpenALImpl.java +++ b/src/main/java/club/sk1er/patcher/util/world/sound/audioswitcher/LibraryLWJGLOpenALImpl.java @@ -30,7 +30,7 @@ public static void createAL() throws LWJGLException { } else { AL.create(); } - } catch (Exception e) { + } catch (Throwable e) { Patcher.instance.getLogger().error("Failed to create device, using system default.", e); AL.destroy(); AL.create();