summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2016-09-29 21:39:15 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2016-09-29 21:39:15 +0100
commit30d8160890749d98b539ab39af6025ec6ded2c78 (patch)
treea1a537bc533d777f203c802cc640be357e69b6fd
parentLots of functionality move to non-template base (diff)
downloadslicer-30d8160890749d98b539ab39af6025ec6ded2c78.tar.bz2
slicer-30d8160890749d98b539ab39af6025ec6ded2c78.tar.xz
slicer-30d8160890749d98b539ab39af6025ec6ded2c78.zip
Don't attempt to get metadata of class we don't have a definition for
-rw-r--r--slicer/tool/parser.cpp6
1 files 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;
}