summaryrefslogtreecommitdiff
path: root/scripting
diff options
context:
space:
mode:
authorEliot Horowitz <eliot@10gen.com>2010-06-07 16:48:53 -0400
committerEliot Horowitz <eliot@10gen.com>2010-06-07 16:48:53 -0400
commit353a2315cf8c5c877e911264a7001d85aef75eda (patch)
tree53088af9079eefe699e19ae19ecd96ed27cf8125 /scripting
parent09c18ee468e20fd8704268ad0779c009e6939ec7 (diff)
downloadmongo-353a2315cf8c5c877e911264a7001d85aef75eda.tar.gz
safer when can't compile
Diffstat (limited to 'scripting')
-rw-r--r--scripting/engine_spidermonkey.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/scripting/engine_spidermonkey.cpp b/scripting/engine_spidermonkey.cpp
index 1f5557a74a4..cfbe938dede 100644
--- a/scripting/engine_spidermonkey.cpp
+++ b/scripting/engine_spidermonkey.cpp
@@ -603,7 +603,9 @@ namespace mongo {
}
case Code:{
JSFunction * func = compileFunction( e.valuestr() );
- return OBJECT_TO_JSVAL( JS_GetFunctionObject( func ) );
+ if ( func )
+ return OBJECT_TO_JSVAL( JS_GetFunctionObject( func ) );
+ return JSVAL_NULL;
}
case CodeWScope:{
JSFunction * func = compileFunction( e.codeWScopeCode() );