diff --git a/runtime/vm/object_service.cc b/runtime/vm/object_service.cc index 7812ac543ec..502e0edf1d3 100644 --- a/runtime/vm/object_service.cc +++ b/runtime/vm/object_service.cc @@ -454,11 +454,11 @@ void Script::PrintJSONImpl(JSONStream* stream, bool ref) const { } // Print the line number table - if (!source.IsNull()) { + const GrowableObjectArray& lineNumberArray = + GrowableObjectArray::Handle(GenerateLineNumberArray()); + if (!lineNumberArray.IsNull()) { JSONArray tokenPosTable(&jsobj, "tokenPosTable"); - const GrowableObjectArray& lineNumberArray = - GrowableObjectArray::Handle(GenerateLineNumberArray()); Object& value = Object::Handle(); intptr_t pos = 0; diff --git a/runtime/vm/report.cc b/runtime/vm/report.cc index ac3989deab8..f68153030a6 100644 --- a/runtime/vm/report.cc +++ b/runtime/vm/report.cc @@ -44,7 +44,7 @@ RawString* Report::PrependSnippet(Kind kind, UNREACHABLE(); } String& result = String::Handle(); - if (!script.IsNull()) { + if (!script.IsNull() && !String::Handle(script.Source()).IsNull()) { const String& script_url = String::Handle(script.url()); if (token_pos.IsReal()) { intptr_t line, column, token_len;