diff --git a/lib/mayaHydra/hydraExtensions/adapters/materialAdapter.cpp b/lib/mayaHydra/hydraExtensions/adapters/materialAdapter.cpp index b69c5b829..e807ab2b5 100644 --- a/lib/mayaHydra/hydraExtensions/adapters/materialAdapter.cpp +++ b/lib/mayaHydra/hydraExtensions/adapters/materialAdapter.cpp @@ -263,7 +263,10 @@ class MayaHydraShadingEngineAdapter : public MayaHydraMaterialAdapter } // Construct a MaterialX document - auto mtlxDocStr = mtlxDocPlug.asString(); + const MString mtlxDocStr = mtlxDocPlug.asString(); + if (0 == mtlxDocStr.length()) { + return false; + } auto mtlxDoc = MaterialX::createDocument(); MaterialX::readFromXmlString(mtlxDoc, mtlxDocStr.asChar());