MothCocoon / FlowGraph

Design-agnostic node system for scripting game’s flow in Unreal Engine
https://discord.gg/Xmtr6GhbmW
MIT License
1.17k stars 228 forks source link

Fix crash in UFlowNode_CallOwnerFunction #191

Closed MaksymKapelianovych closed 4 months ago

MaksymKapelianovych commented 5 months ago

Add RequiredParamsClass validation to prevent crash in UFlowNode_CallOwnerFunction (with valid non-empty function ref) when user change owner class to default and then press Refresh

MaksymKapelianovych commented 5 months ago

I decided not to set Params to nullptr, because we still have non-empty function name, and it would require to clear it as well. If user decides to set valid owner class back, function info for node will be lost, and user will need to set it back manually. Undo can help to revert changes, but there is a chance that some other nodes will be already modified until user notice and reverting all that work just to restore function info is not very convenient.

MaksymKapelianovych commented 5 months ago

Steps to reproduce:

  1. Set Expected Owner Class to some class, that contains function with correct signature for UFlowNode_CallOwnerFunction (let's call it Function1)
  2. Add UFlowNode_CallOwnerFunction to graph and set its parameter Function to Function1
  3. Change Expected Owner Class to some class, that does not contain Function1
  4. Click Refresh
MothDoctor commented 4 months ago

Accepted, thanks for this! :)