--- a/src/linetypes/modelobject.cpp Sat Mar 31 21:23:22 2018 +0300 +++ b/src/linetypes/modelobject.cpp Sun Apr 01 11:39:07 2018 +0300 @@ -164,19 +164,24 @@ bool deep, bool render ) { - Model inlined {context}; - fileInfo(context)->inlineContents(inlined, deep, render); + LDDocument* subfile = this->fileInfo(context); - // Transform the objects - for (LDObject* object : inlined) + if (subfile != nullptr) { - if (::shouldInvert(this, parentWinding, context)) - ::invert(object, context); + Model inlined {context}; + subfile->inlineContents(inlined, deep, render); - TransformObject(object, transformationMatrix(), position(), color()); + // Transform the objects + for (LDObject* object : inlined) + { + if (::shouldInvert(this, parentWinding, context)) + ::invert(object, context); + + TransformObject(object, transformationMatrix(), position(), color()); + } + + model.merge(inlined); } - - model.merge(inlined); } // =============================================================================