Bug 523216. Check for NULL message in NPN_SetException. r=joshmoz

This commit is contained in:
Jonathan Griffin 2009-10-30 13:15:22 -07:00
Родитель ef7987072d
Коммит 6caac7613e
2 изменённых файлов: 13 добавлений и 1 удалений

Просмотреть файл

@ -1791,6 +1791,8 @@ _setexception(NPObject* npobj, const NPUTF8 *message)
return;
}
if (!message) return;
if (gNPPException) {
// If a plugin throws multiple exceptions, we'll only report the
// last one for now.

Просмотреть файл

@ -38,7 +38,17 @@
catch (e) {
is(e, "second exception", "wrong exception thrown");
}
// test calling exception with NULL message
plugin.throwExceptionNextInvoke();
try {
plugin();
ok(false, "exception not thrown");
}
catch (e) {
is(e.message, "Error calling method on NPObject!", "wrong exception thrown");
}
SimpleTest.finish();
}
</script>