From ce55909b635dd158dfbf2acd773c0068da1a07ec Mon Sep 17 00:00:00 2001 From: "rmacnak@google.com" Date: Mon, 5 Aug 2013 18:54:01 +0000 Subject: [PATCH] Deal with "classes" that don't belong to any library. Addresses issue 12231. Review URL: https://codereview.chromium.org/22043005/ git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25785 260f80e4-7a28-3924-810f-c04153c831b5 --- runtime/lib/mirrors.cc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/runtime/lib/mirrors.cc b/runtime/lib/mirrors.cc index 176aecb5854..874915f014d 100644 --- a/runtime/lib/mirrors.cc +++ b/runtime/lib/mirrors.cc @@ -362,7 +362,13 @@ DEFINE_NATIVE_ENTRY(ClassMirror_name, 1) { DEFINE_NATIVE_ENTRY(ClassMirror_library, 1) { GET_NON_NULL_NATIVE_ARGUMENT(MirrorReference, ref, arguments->NativeArgAt(0)); const Class& klass = Class::Handle(ref.GetClassReferent()); - return CreateLibraryMirror(Library::Handle(klass.library())); + const Library& library = Library::Handle(klass.library()); + // TODO(rmacnak): Revisit when we decide what to do about + // reflectClass(dynamic). + if (library.IsNull()) { + return Instance::null(); + } + return CreateLibraryMirror(library); }