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

Unified Diff: runtime/vm/object.cc

Issue 183023011: Use HasResolvedTypeClass to avoid crash in Field::PrintToJSONStream. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 10 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: runtime/vm/object.cc
diff --git a/runtime/vm/object.cc b/runtime/vm/object.cc
index 15cc8a227f45f7aaa65e95175f306b946b26e646..407a8043c2e379b8724e1a26b107f4cc3020463d 100644
--- a/runtime/vm/object.cc
+++ b/runtime/vm/object.cc
@@ -6397,9 +6397,15 @@ void Field::PrintToJSONStream(JSONStream* stream, bool ref) const {
}
jsobj.AddProperty("owner", cls);
+
+ // TODO(turnidge): Once the vmservice supports returning types,
+ // return the type here instead of the class.
AbstractType& declared_type = AbstractType::Handle(type());
- cls = declared_type.type_class();
- jsobj.AddProperty("declared_type", cls);
+ if (declared_type.HasResolvedTypeClass()) {
+ cls = declared_type.type_class();
+ jsobj.AddProperty("declared_type", cls);
+ }
+
jsobj.AddProperty("static", is_static());
jsobj.AddProperty("final", is_final());
jsobj.AddProperty("const", is_const());
« 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