Created
July 13, 2011 16:32
-
-
Save osheroff/1080695 to your computer and use it in GitHub Desktop.
Don't crash when compile of CodeWScope fails
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/scripting/engine_spidermonkey.cpp b/scripting/engine_spidermonkey.cpp | |
index 88f48e3..0f36817 100644 | |
--- a/scripting/engine_spidermonkey.cpp | |
+++ b/scripting/engine_spidermonkey.cpp | |
@@ -662,6 +662,9 @@ namespace mongo { | |
case CodeWScope: { | |
JSFunction * func = compileFunction( e.codeWScopeCode() ); | |
+ if ( !func ) | |
+ return JSVAL_NULL; | |
+ | |
BSONObj extraScope = e.codeWScopeObject(); | |
if ( ! extraScope.isEmpty() ) { | |
log() << "warning: CodeWScope doesn't transfer to db.eval" << endl; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment