From 30d8160890749d98b539ab39af6025ec6ded2c78 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Thu, 29 Sep 2016 21:39:15 +0100 Subject: Don't attempt to get metadata of class we don't have a definition for --- slicer/tool/parser.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/slicer/tool/parser.cpp b/slicer/tool/parser.cpp index 99d3f5f..c541ec1 100644 --- a/slicer/tool/parser.cpp +++ b/slicer/tool/parser.cpp @@ -552,8 +552,10 @@ namespace Slicer { if (auto cd = Slice::ClassDeclPtr::dynamicCast(typec)) { typec = cd->definition(); } - auto typeMetadata = typec->getMetaData(); - std::copy(typeMetadata.begin(), typeMetadata.end(), std::back_inserter(metadata)); + if (typec) { + auto typeMetadata = typec->getMetaData(); + std::copy(typeMetadata.begin(), typeMetadata.end(), std::back_inserter(metadata)); + } } return metadata; } -- cgit v1.2.3