Index: src/isolate.cc |
diff --git a/src/isolate.cc b/src/isolate.cc |
index 7b77d893f15451738d6ecada03a7eafa7ca600de..653ff2ef79d4593b3de0e1da7bdbc3e9708cdc93 100644 |
--- a/src/isolate.cc |
+++ b/src/isolate.cc |
@@ -1400,17 +1400,19 @@ void Isolate::DoThrow(Object* exception, MessageLocation* location) { |
// to the console for easier debugging. |
int line_number = GetScriptLineNumberSafe(location->script(), |
location->start_pos()); |
- if (exception->IsString()) { |
+ if (exception->IsString() && location->script()->name()->IsString()) { |
OS::PrintError( |
"Extension or internal compilation error: %s in %s at line %d.\n", |
*String::cast(exception)->ToCString(), |
*String::cast(location->script()->name())->ToCString(), |
line_number + 1); |
- } else { |
+ } else if (location->script()->name()->IsString()) { |
OS::PrintError( |
"Extension or internal compilation error in %s at line %d.\n", |
*String::cast(location->script()->name())->ToCString(), |
line_number + 1); |
+ } else { |
+ OS::PrintError("Extension or internal compilation error.\n"); |
} |
} |
} |