浏览代码

Merge pull request #4738 from kaushikprajapati/patch-1

Update Timer.hx
Dan Korostelev 9 年之前
父节点
当前提交
8c2c742418
共有 1 个文件被更改,包括 4 次插入2 次删除
  1. 4 2
      std/haxe/Timer.hx

+ 4 - 2
std/haxe/Timer.hx

@@ -88,8 +88,10 @@ class Timer {
 			#end
 			id = null;
 		#elseif java
-			timer.cancel();
-			timer = null;
+			if(timer != null) {
+				timer.cancel();
+				timer = null;
+			}
 			task = null;
 		#end
 	}