Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Fix segfault with lua.
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Mon, 12 Apr 2021 19:41:51 +0000 (21:41 +0200)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Mon, 12 Apr 2021 19:41:51 +0000 (21:41 +0200)
src/bindings/lua/lua_platf.cpp

index 3ad9dc8..865f501 100644 (file)
@@ -311,7 +311,7 @@ int console_add_router(lua_State* L) {
   const char* coords = lua_tostring(L, -1);
   lua_pop(L,1);
 
-  sg_platf_new_router(name, coords);
+  sg_platf_new_router(name, coords ? coords : "");
 
   return 0;
 }