Browse Source

Safe guarding eval code result from null values

Sebastien Ros 12 years ago
parent
commit
ecea61f082
1 changed files with 1 additions and 1 deletions
  1. 1 1
      Jint/Native/Function/EvalFunctionInstance.cs

+ 1 - 1
Jint/Native/Function/EvalFunctionInstance.cs

@@ -21,7 +21,7 @@ namespace Jint.Native.Function
 
 
             var parser = new JavascriptParser();
             var parser = new JavascriptParser();
             var program = parser.Parse(code);
             var program = parser.Parse(code);
-            return _engine.ExecuteStatement(program).Value;
+            return _engine.ExecuteStatement(program).Value ?? Undefined.Instance;
         }
         }
     }
     }
 }
 }