aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlkalus <3060479+draknyte1@users.noreply.github.com>2019-08-18 00:07:08 +0100
committerAlkalus <3060479+draknyte1@users.noreply.github.com>2019-08-18 00:07:08 +0100
commit5adad05da2f1182d90ed5c596932b4b583ece73e (patch)
tree89324d3ed551a3a197e94a5a3f8ca446b128b8f1
parent3d43bc8374278efd6eceaff50e9c4ad04fb1d64f (diff)
downloadGT5-Unofficial-5adad05da2f1182d90ed5c596932b4b583ece73e.tar.gz
GT5-Unofficial-5adad05da2f1182d90ed5c596932b4b583ece73e.tar.bz2
GT5-Unofficial-5adad05da2f1182d90ed5c596932b4b583ece73e.zip
$ Fixed NPE in Music Fix.
-rw-r--r--src/Java/gtPlusPlus/plugin/fixes/vanilla/VanillaBackgroundMusicFix.java16
1 files changed, 10 insertions, 6 deletions
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();
+ }
}
}
}