From afab2466dcc6872f05ad0617fafcf04ab0ebe367 Mon Sep 17 00:00:00 2001 From: Wolfgang Thaller Date: Thu, 30 Oct 2014 03:05:02 +0100 Subject: [PATCH] don't crash on unknown types --- Rez/RezWorld.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Rez/RezWorld.cc b/Rez/RezWorld.cc index ae21be0d91..d97ae6f1b7 100644 --- a/Rez/RezWorld.cc +++ b/Rez/RezWorld.cc @@ -13,6 +13,8 @@ RezWorld::RezWorld() void RezWorld::addTypeDefinition(TypeSpec spec, TypeDefinitionPtr type) { + if(!type) + return; types[spec] = type; } @@ -34,7 +36,8 @@ void RezWorld::addResource(ResSpec spec, CompoundExprPtr body, yy::location loc) if(verboseFlag) std::cout << "RESOURCE " << spec.type() << "(" << spec.id() << ", " << "\"" << spec.name() << "\"" << spec.attr() << ")" << std::endl; TypeDefinitionPtr def = getTypeDefinition(spec.type(), spec.id(), loc); - + if(!def) + return; ResourceCompiler compiler(*this, def, body, verboseFlag); compiler.compile();