Commit #7: Events thread-based + new easier Extractor.py + our own Timer class
[smartthings-infrastructure.git] / Methods / unschedule.groovy
index 168962149f4a14c8840169d6af475f22f047aab0..322d80583d785a5631c6b7245495d05f67f56c2e 100644 (file)
@@ -3,7 +3,16 @@
 def unschedule(Closure functionToUnschedule) {
        for (int i = 0;i < timersFuncList.size();i++) {
                if (timersFuncList[i] == functionToUnschedule) {
-                       timersList[i].cancel()
+                       if (timersList != null)
+                               timersList[i].cancel()
                }
        }
 }
+
+
+def unschedule() {
+       for (int i = 0;i < timersFuncList.size();i++) {
+               if (timersList != null)
+                       timersList[i].cancel()
+       }
+}