We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent daad5df commit a7db179Copy full SHA for a7db179
IOS/LuaViewSDK/Classes/lv514/lVoadlib.c
@@ -481,7 +481,10 @@ static int ll_require (lv_State *L) {
481
lv_pushlightuserdata(L, sentinel);
482
lv_setfield(L, 2, name); /* _LOADED[name] = sentinel */
483
lv_pushstring(L, name); /* pass name as argument to module */
484
- lv_call(L, 1, 1); /* run loaded module */
+ int status = lv_pcall(L, 1, 1, 0); /* run loaded module */
485
+ /* error occured? */
486
+ if (status != 0)
487
+ return 0; /* return nil */
488
if (!lv_isnil(L, -1)) /* non-nil return? */
489
lv_setfield(L, 2, name); /* _LOADED[name] = returned value */
490
lv_getfield(L, 2, name);
0 commit comments