From 5adad05da2f1182d90ed5c596932b4b583ece73e Mon Sep 17 00:00:00 2001 From: Alkalus <3060479+draknyte1@users.noreply.github.com> Date: Sun, 18 Aug 2019 00:07:08 +0100 Subject: $ Fixed NPE in Music Fix. --- .../plugin/fixes/vanilla/VanillaBackgroundMusicFix.java | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'src/Java/gtPlusPlus/plugin') diff --git a/src/Java/gtPlusPlus/plugin/fixes/vanilla/VanillaBackgroundMusicFix.java b/src/Java/gtPlusPlus/plugin/fixes/vanilla/VanillaBackgroundMusicFix.java index 0039de7da2..bfd73407f7 100644 --- a/src/Java/gtPlusPlus/plugin/fixes/vanilla/VanillaBackgroundMusicFix.java +++ b/src/Java/gtPlusPlus/plugin/fixes/vanilla/VanillaBackgroundMusicFix.java @@ -35,10 +35,12 @@ public class VanillaBackgroundMusicFix implements IBugFix { } public void manage() { - TimerTask task = new ManageTask(this.mFixInstance); - Timer timer = new Timer("BGM-WatchDog"); - long delay = 1000 * 60; - timer.scheduleAtFixedRate(task, delay, 5000); + if (CORE_Preloader.enableWatchdogBGM > 0 && Utils.isClient()) { + TimerTask task = new ManageTask(this.mFixInstance); + Timer timer = new Timer("BGM-WatchDog"); + long delay = 1000 * 60; + timer.scheduleAtFixedRate(task, delay, 5000); + } } private static class ManageTask extends TimerTask { @@ -50,8 +52,10 @@ public class VanillaBackgroundMusicFix implements IBugFix { @Override public void run() { - if (!A.mVanillaManager) { - A.run(); + if (CORE_Preloader.enableWatchdogBGM > 0 && Utils.isClient()) { + if (!A.mVanillaManager) { + A.run(); + } } } } -- cgit