add trys around canceling tasks to prevent breaking

This commit is contained in:
ajgeiss0702
2020-12-06 15:49:39 -07:00
parent 3de7e77e66
commit d29ce83665
+15 -5
View File
@@ -85,23 +85,33 @@ public class Manager {
*/ */
public void reloadIntervals() { public void reloadIntervals() {
if(sendId != -1) { if(sendId != -1) {
pl.getProxy().getScheduler().cancel(sendId); try {
pl.getProxy().getScheduler().cancel(sendId);
} catch(IllegalArgumentException e) {}
sendId = -1; sendId = -1;
} }
if(updateId != -1) { if(updateId != -1) {
pl.getProxy().getScheduler().cancel(updateId); try {
pl.getProxy().getScheduler().cancel(updateId);
} catch(IllegalArgumentException e) {}
updateId = -1; updateId = -1;
} }
if(messagerId != -1) { if(messagerId != -1) {
pl.getProxy().getScheduler().cancel(messagerId); try {
pl.getProxy().getScheduler().cancel(messagerId);
} catch(IllegalArgumentException e) {}
messagerId = -1; messagerId = -1;
} }
if(actionbarId != -1) { if(actionbarId != -1) {
pl.getProxy().getScheduler().cancel(actionbarId); try {
pl.getProxy().getScheduler().cancel(actionbarId);
} catch(IllegalArgumentException e) {}
actionbarId = -1; actionbarId = -1;
} }
if(srvRefId != -1) { if(srvRefId != -1) {
pl.getProxy().getScheduler().cancel(srvRefId); try {
pl.getProxy().getScheduler().cancel(srvRefId);
} catch(IllegalArgumentException e) {}
srvRefId = -1; srvRefId = -1;
} }