Преглед на файлове

Update Timer.hx

There is a potential null pointer exception waiting to happen if the stop is being called multiple times or it could even happen if stop is being called from two different threads.
kaushikprajapati преди 9 години
родител
ревизия
e01e06e0d3
променени са 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
 	}