Skip to content

Commit 57ce4df

Browse files
kwokcbashwinbhat
authored andcommitted
Fix dot node crash in code generation (AcademySoftwareFoundation#2505)
Code attempts to use `in` on `dot` not without checking for existence on the node. It will not be exposed (added) as a uniform input if it's connected as is the case with the `dot` nodes used in the open_pbr to standard_surface conversion graph. Simply add in a firewall check for existence first.
1 parent 4431ce0 commit 57ce4df

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

source/MaterialXGenShader/ShaderGraph.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -911,7 +911,7 @@ void ShaderGraph::optimize()
911911
{
912912
// Filename dot nodes must be elided so they do not create extra samplers.
913913
ShaderInput* in = node->getInput("in");
914-
if (in->getType() == Type::FILENAME)
914+
if (in && in->getType() == Type::FILENAME)
915915
{
916916
bypass(node, 0);
917917
++numEdits;

0 commit comments

Comments
 (0)