EverNewJoy / VictoryPlugin

Rama's Victory BP Plugin
MIT License
867 stars 256 forks source link

Fix WidgetGetParentOfClass not working when immediate parent is UserW… #10

Closed rcywongaa closed 7 years ago

rcywongaa commented 8 years ago

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()

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

EverNewJoy commented 7 years ago

Thank you for the contribution, I think this has been addressed now by the author of tha tnode Kris.