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

Unified Diff: chrome/renderer/module_system.cc

Issue 10873095: *v8::String::Utf8Value can return NULL. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: more better Created 8 years, 4 months 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: chrome/renderer/module_system.cc
diff --git a/chrome/renderer/module_system.cc b/chrome/renderer/module_system.cc
index 97a3bd38d9e32d549a984a157ed67e37762945c1..7ce0c6e7d8ee782b93d3c3035ebf613c837f35f7 100644
--- a/chrome/renderer/module_system.cc
+++ b/chrome/renderer/module_system.cc
@@ -78,8 +78,13 @@ void ModuleSystem::DumpException(const v8::TryCatch& try_catch) {
error_message = *v8::String::Utf8Value(message->Get());
std::string stack_trace = "<stack trace unavailable>";
- if (!try_catch.StackTrace().IsEmpty())
- stack_trace = *v8::String::Utf8Value(try_catch.StackTrace());
+ if (!try_catch.StackTrace().IsEmpty()) {
+ v8::String::Utf8Value stack_value(try_catch.StackTrace());
eaugusti 2012/08/27 22:39:55 I think this should be v8::Handle<v8::String::Utf8
+ if (*stack_value)
+ stack_trace.assign(*stack_value, stack_value.length());
+ else
+ stack_trace = "<could not convert stack trace to string>";
+ }
LOG(ERROR) << "[" << resource_name << "(" << message->GetLineNumber() << ")] "
<< error_message
« 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