Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(167)

Unified Diff: extensions/renderer/module_system.cc

Issue 2552533002: [extensions] added checks that function is not empty (Closed)
Patch Set: Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/renderer/module_system.cc
diff --git a/extensions/renderer/module_system.cc b/extensions/renderer/module_system.cc
index e583efcaa730360068ee32c6bef75aae1d61bfd0..a8e3bdb07e23bb8a6f340ba30d965b36e425cd84 100644
--- a/extensions/renderer/module_system.cc
+++ b/extensions/renderer/module_system.cc
@@ -309,6 +309,10 @@ v8::Local<v8::Value> ModuleSystem::CallModuleMethod(
v8::Local<v8::Function> function =
GetModuleFunction(module_name, method_name);
+ if (function.IsEmpty()) {
+ NOTREACHED() << "GetModuleFunction() returns empty function handle";
+ return handle_scope.Escape(v8::Undefined(GetIsolate()));
+ }
v8::Local<v8::Value> result;
{
@@ -350,6 +354,10 @@ void ModuleSystem::CallModuleMethodSafe(const std::string& module_name,
v8::Local<v8::Function> function =
GetModuleFunction(module_name, method_name);
+ if (function.IsEmpty()) {
+ NOTREACHED() << "GetModuleFunction() returns empty function handle";
+ return;
+ }
{
v8::TryCatch try_catch(GetIsolate());
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698