我有问题; 我必须在表格中查看我的程序中的一个字段.
if(launchArgs.androidIntent.extras.notification.custom.test_field ~= nil)then...
Run Code Online (Sandbox Code Playgroud)
当这个索引存在时一切正常,但是当它不存在时,我收到一个错误:
Attempt to index field 'notification' (a nil value).
Run Code Online (Sandbox Code Playgroud)
这是可以理解的.如何检查该索引是否存在?