Index: runtime/vm/object_service.cc |
diff --git a/runtime/vm/object_service.cc b/runtime/vm/object_service.cc |
index baace752527f97a1292392981e207ac6dc7f0618..50c659ee44fdb8edfc9e029e0fd2362e2a53485b 100644 |
--- a/runtime/vm/object_service.cc |
+++ b/runtime/vm/object_service.cc |
@@ -568,19 +568,21 @@ void Library::PrintJSONImpl(JSONStream* stream, bool ref) const { |
if (entry.IsLibraryPrefix()) { |
prefix ^= entry.raw(); |
ports = prefix.imports(); |
- for (intptr_t i = 0; i < ports.Length(); i++) { |
- ns ^= ports.At(i); |
- if (ns.IsNull()) continue; |
- |
- JSONObject jsdep(&jsarr); |
- jsdep.AddProperty("isDeferred", prefix.is_deferred_load()); |
- jsdep.AddProperty("isExport", false); |
- jsdep.AddProperty("isImport", true); |
- prefixName = prefix.name(); |
- ASSERT(!prefixName.IsNull()); |
- jsdep.AddProperty("prefix", prefixName.ToCString()); |
- target = ns.library(); |
- jsdep.AddProperty("target", target); |
+ if (!ports.IsNull()) { |
+ for (intptr_t i = 0; i < ports.Length(); i++) { |
+ ns ^= ports.At(i); |
+ if (ns.IsNull()) continue; |
+ |
+ JSONObject jsdep(&jsarr); |
+ jsdep.AddProperty("isDeferred", prefix.is_deferred_load()); |
+ jsdep.AddProperty("isExport", false); |
+ jsdep.AddProperty("isImport", true); |
+ prefixName = prefix.name(); |
+ ASSERT(!prefixName.IsNull()); |
+ jsdep.AddProperty("prefix", prefixName.ToCString()); |
+ target = ns.library(); |
+ jsdep.AddProperty("target", target); |
+ } |
} |
} |
} |