Closed drabont7 closed 2 years ago
Here you have to check DrivingEntity for not 'null' (with "ok" or "if" ) before you want to access further data.
Here you have to check DrivingEntity for not 'null' (with "ok" or "if" ) before you want to access further data.
code: {{#test E.S.Players.length 'ge' 0}} {{#if E.S.Players.[0].DrivingEntity}} {{E.S.Players.[0].DrivingEntity.Name}} {{/if}} {{/test}}
show an error: "{test} [1 ge 0 ]:Exception has been thrown by the target of an invocation. 13:23:50"
Empyrion 1.8.3 3849 04-10:26, SP, EmpyrionScripting by ASTIC/TC Version:11.0.0.0,
Describe the bug {{E.S.Players.[0].DrivingEntity.Name}} An attempt to access any field of an empty DrivingEntity object results in an error. An attempt to handle the error using the helpers: "if" and "ok" fails.
To Reproduce lcd script, tested in single and server
Expected behavior Reading a value must return a value or void which can be checked using helpers.