Index: chrome/renderer/module_system.cc |
=================================================================== |
--- chrome/renderer/module_system.cc (revision 153794) |
+++ chrome/renderer/module_system.cc (working copy) |
@@ -59,11 +59,18 @@ |
// static |
void ModuleSystem::DumpException(v8::Handle<v8::Message> message) { |
- LOG(ERROR) << "[" |
- << *v8::String::Utf8Value( |
- message->GetScriptResourceName()->ToString()) |
- << "(" << message->GetLineNumber() << ")] " |
- << *v8::String::Utf8Value(message->Get()); |
+ std::string resource_name = "<unknown resource>"; |
+ if (!message->GetScriptResourceName().IsEmpty()) { |
+ resource_name = *v8::String::Utf8Value( |
+ message->GetScriptResourceName()->ToString()); |
+ } |
+ |
+ std::string error_message = "<no error message>"; |
+ if (!message->Get().IsEmpty()) |
+ error_message = *v8::String::Utf8Value(message->Get()); |
+ |
+ LOG(ERROR) << "[" << resource_name << "(" << message->GetLineNumber() << ")] " |
+ << error_message; |
} |
void ModuleSystem::Require(const std::string& module_name) { |