Tencent / UnLua

A feature-rich, easy-learning and highly optimized Lua scripting plugin for UE.
Other
2.24k stars 614 forks source link

解决lua调用c++自定义导出函数传递nil参数奔溃问题 #711

Open skywhub opened 3 months ago

skywhub commented 3 months ago

对于自定义导出的给lua调用的绑定函数,struct值或者引用参数传递nil会直接导致crash,对此情况新增GetArgsChecked接口用于接收参数时做检查以lua error代替直接crash。

GetArgs必定奔溃例子:UE.FVector.DistSquared(nil, UE.FVector(0,0,0))

tencent-adm commented 3 months ago

CLA assistant check
All committers have signed the CLA.