foxygit / fake-08-xbox360 Log in
commit d3b0e2a9a4b933b8f3bce447a4931fbac02e4f99
Author:     jtothebell <j.to.the.bell@gmail.com>
AuthorDate: Fri Jun 18 08:25:17 2021 -0600
Commit:     jtothebell <j.to.the.bell@gmail.com>
CommitDate: Fri Jun 18 08:25:17 2021 -0600

    handle nil args in load
---
 source/picoluaapi.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/source/picoluaapi.cpp b/source/picoluaapi.cpp
index d76df69..2e5ec02 100644
--- a/source/picoluaapi.cpp
+++ b/source/picoluaapi.cpp
@@ -1114,10 +1114,10 @@ int load(lua_State *L) {
     const char* param = "";
     if (lua_isstring(L, 1)){
         filename = lua_tolstring(L, 1, nullptr);
-        if (lua_gettop(L) > 1){
+        if (lua_gettop(L) > 1 && lua_isstring(L, 2)){
             breadcrumb = lua_tolstring(L, 2, nullptr);
         }
-        if (lua_gettop(L) > 2){
+        if (lua_gettop(L) > 2 && lua_isstring(L, 2)){
             param = lua_tolstring(L, 3, nullptr);
         }