Browse Source

[js] check for null in haxe.CallStack.makeStack

Dan Korostelev 10 năm trước cách đây
mục cha
commit
d0ccf5f02c
1 tập tin đã thay đổi với 3 bổ sung1 xóa
  1. 3 1
      std/haxe/CallStack.hx

+ 3 - 1
std/haxe/CallStack.hx

@@ -293,7 +293,9 @@ class CallStack {
 			}
 			return m;
 		#elseif js
-			if ((untyped __js__("typeof"))(s) == "string") {
+			if (s == null) {
+				return [];
+			} else if ((untyped __js__("typeof"))(s) == "string") {
 				// Return the raw lines in browsers that don't support prepareStackTrace
 				var stack : Array<String> = s.split("\n");
 				if( stack[0] == "Error" ) stack.shift();