Steps to reproduce:
Create a UserWidget called MyWidget
Create another UserWidget called MyWidget2
Remove the default canvas panel from MyWidget2 and add MyWidget to it
Inside Graph of MyWidget2, use WidgetGetParentOfClass(MyWidget2, UserWidget)
Expected results: WidgetGetParentOfClass should return MyWidget
Actual results: WidgetGetParentOfClass returns null
Cause: On line 5109, ChildWidget->GetParent() returns null since the parent is a UserWidget hence the loop on line 5113 is never entered hence never using GetOuter() to reach MyWidget
Fix: If ChildWidget->GetParent() returns null, fall back to GetOuter()
Steps to reproduce: Create a
UserWidget
calledMyWidget
Create anotherUserWidget
calledMyWidget2
Remove the defaultcanvas panel
fromMyWidget2
and addMyWidget
to it Inside Graph ofMyWidget2
, useWidgetGetParentOfClass(MyWidget2, UserWidget)
Expected results:
WidgetGetParentOfClass
should returnMyWidget
Actual results:WidgetGetParentOfClass
returns nullCause: On line 5109,
ChildWidget->GetParent()
returns null since the parent is aUserWidget
hence the loop on line 5113 is never entered hence never usingGetOuter()
to reachMyWidget
Fix: If
ChildWidget->GetParent()
returns null, fall back toGetOuter()
Fixes issue as mentioned https://github.com/EverNewJoy/VictoryPlugin/issues/9
Feel free to modify / tell me how you wish to fix this as my solution probably isn't the most elegant of ways