File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change 99#include "laco.h"
1010#include "util.h"
1111
12- void laco_print_debug_info (struct LacoState * laco ,
13- const char * function_name ) {
12+ void laco_print_debug_info (LacoState * laco , const char * function_name ) {
1413 int i ;
1514 char * namespace ;
1615 lua_State * L = laco_get_laco_lua_state (laco );
@@ -23,7 +22,15 @@ void laco_print_debug_info(struct LacoState* laco,
2322 /* Walk down the namespace if there is something to go down */
2423 for (i = 0 ; (namespace = namespaces [i ]); i ++ ) {
2524 lua_getfield (L , index , namespace );
25+
2626 index = lua_gettop (L );
27+
28+ if (lua_type (L , index ) == LUA_TNIL ) {
29+ printf ("Couldn't find the function named \"%s\"\n" , function_name );
30+ lua_pop (L , i + 1 );
31+
32+ return ;
33+ }
2734 }
2835
2936 lua_getinfo (L , ">Sl" , & debug_info );
You can’t perform that action at this time.
0 commit comments