diff options
author | Eliot Horowitz <eliot@10gen.com> | 2010-06-07 16:48:53 -0400 |
---|---|---|
committer | Eliot Horowitz <eliot@10gen.com> | 2010-06-07 16:48:53 -0400 |
commit | 353a2315cf8c5c877e911264a7001d85aef75eda (patch) | |
tree | 53088af9079eefe699e19ae19ecd96ed27cf8125 /scripting | |
parent | 09c18ee468e20fd8704268ad0779c009e6939ec7 (diff) | |
download | mongo-353a2315cf8c5c877e911264a7001d85aef75eda.tar.gz |
safer when can't compile
Diffstat (limited to 'scripting')
-rw-r--r-- | scripting/engine_spidermonkey.cpp | 4 |
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() ); |