From 71e3ed5868f8b3e83192085bd850e5b7cc00094a Mon Sep 17 00:00:00 2001 From: kaetemi Date: Mon, 16 Mar 2020 02:33:07 +0800 Subject: [PATCH] Fix NULL _Parent and uninitialized parentId --- code/nel/src/gui/interface_group.cpp | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/code/nel/src/gui/interface_group.cpp b/code/nel/src/gui/interface_group.cpp index 2b899aca1..8f1d104c9 100644 --- a/code/nel/src/gui/interface_group.cpp +++ b/code/nel/src/gui/interface_group.cpp @@ -622,13 +622,30 @@ namespace NLGUI { std::string parentId; - if( value != "parent" ){ - if( _Parent != NULL ) + if (value != "parent") + { + if (_Parent != NULL) + { parentId = _Parent->getId() + ":" + value; + } else + { + parentId = "ui:" + value; + } + } + else + { + if (_Parent) + { parentId = _Parent->getId(); + } + else + { + parentId = value; + } } - CWidgetManager::getInstance()->getParser()->addParentSizeMaxAssociation( this, parentId ); + + CWidgetManager::getInstance()->getParser()->addParentSizeMaxAssociation(this, parentId); return; } else