nullptr check added

This commit is contained in:
Uwe Rathmann 2024-11-14 10:51:53 +01:00
parent 8dd5a7b249
commit d1c2751a8e
1 changed files with 8 additions and 5 deletions

View File

@ -87,6 +87,8 @@ void QskSGNode::setParentNode( QSGNode* node, QSGNode* parent )
} }
QSGNode* QskSGNode::findChildNode( QSGNode* parent, quint8 role ) QSGNode* QskSGNode::findChildNode( QSGNode* parent, quint8 role )
{
if ( parent )
{ {
auto node = parent->firstChild(); auto node = parent->firstChild();
while ( node ) while ( node )
@ -96,6 +98,7 @@ QSGNode* QskSGNode::findChildNode( QSGNode* parent, quint8 role )
node = node->nextSibling(); node = node->nextSibling();
} }
}
return nullptr; return nullptr;
} }