Description

We don't clearly define the behavior for a Blueprint function when an execution path without a return node is taken. We should either report an error, or have the function return the default initialization of the type (eg: false for bool, 0 for int, etc).

Steps to Reproduce
  • Download WDT_Test.uasset attachment.
  • Create an empty map.
  • Open the level Blueprint.
  • Add a "Create Widget" node to the BeginPlay event.
  • Set WDT_Test as the widget class for the node.
  • Connect a GetPlayerController node to the Owning Player pin of the widget node.
  • Connect a Add to Viewport node to the widget node's output.
  • In WDT_Test's TestFunc, set a breakpoint on the print node that displays "Func: False".
  • Play in viewport.
  • After breakpoint hits, step out of function.
  • Observe that the branch in the even graph takes the true path and not that false one.

Have Comments or More Details?

There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-142399 in the post.

5
Login to Vote

Backlogged
ComponentUE - Gameplay - Blueprint
Affects Versions4.27
CreatedFeb 11, 2022
UpdatedSep 22, 2022