nullptr check added

This commit is contained in:
Uwe Rathmann 2024-11-14 10:51:53 +01:00
parent 8dd5a7b249
commit d1c2751a8e

View File

@ -88,13 +88,16 @@ void QskSGNode::setParentNode( QSGNode* node, QSGNode* parent )
QSGNode* QskSGNode::findChildNode( QSGNode* parent, quint8 role ) QSGNode* QskSGNode::findChildNode( QSGNode* parent, quint8 role )
{ {
auto node = parent->firstChild(); if ( parent )
while ( node )
{ {
if ( nodeRole( node ) == role ) auto node = parent->firstChild();
return node; while ( node )
{
if ( nodeRole( node ) == role )
return node;
node = node->nextSibling(); node = node->nextSibling();
}
} }
return nullptr; return nullptr;