diff options
author | Leon Clarke <leonclarke@google.com> | 2010-02-26 17:29:17 +0000 |
---|---|---|
committer | Leon Clarke <leonclarke@google.com> | 2010-02-26 17:29:17 +0000 |
commit | 415bfdfb5c693e81bff6b4c4ec2435df6f5aedc3 (patch) | |
tree | e6c0561da5140811184aed0bd06e32123843da20 /WebCore/bindings/v8 | |
parent | 2cfbb169e5870d377ef9986b5cd74713abb38ca7 (diff) | |
download | external_webkit-415bfdfb5c693e81bff6b4c4ec2435df6f5aedc3.zip external_webkit-415bfdfb5c693e81bff6b4c4ec2435df6f5aedc3.tar.gz external_webkit-415bfdfb5c693e81bff6b4c4ec2435df6f5aedc3.tar.bz2 |
Don't crash when throwing javascript exceptions from plugins without
javascript having been initialised.
Diffstat (limited to 'WebCore/bindings/v8')
-rw-r--r-- | WebCore/bindings/v8/NPV8Object.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/WebCore/bindings/v8/NPV8Object.cpp b/WebCore/bindings/v8/NPV8Object.cpp index 53ceea1..06243d4 100644 --- a/WebCore/bindings/v8/NPV8Object.cpp +++ b/WebCore/bindings/v8/NPV8Object.cpp @@ -413,7 +413,11 @@ void _NPN_SetException(NPObject* npObject, const NPUTF8 *message) if (!npObject || npObject->_class != npScriptObjectClass) { // We won't be able to find a proper scope for this exception, so just throw it. // This is consistent with JSC, which throws a global exception all the time. - V8Proxy::throwError(V8Proxy::GeneralError, message); +#if PLATFORM(ANDROID) + // However, if there isn't a v8 context, throw the error away as there really isn't anything useful to do with it. + if (v8::Context::InContext()) + V8Proxy::throwError(V8Proxy::GeneralError, message); +#endif return; } v8::HandleScope handleScope; |