From 528c1e239023c841c0fc3214de672990bbee720e Mon Sep 17 00:00:00 2001 From: Alex Szpakowski Date: Fri, 2 Aug 2019 21:04:22 -0300 Subject: [PATCH] love.filesystem's loaders in the package.loaders table error instead of crashing when no argument is given to them (resolves issue #1504). --- src/modules/filesystem/wrap_Filesystem.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/modules/filesystem/wrap_Filesystem.cpp b/src/modules/filesystem/wrap_Filesystem.cpp index df95ee71b..9c1c43633 100644 --- a/src/modules/filesystem/wrap_Filesystem.cpp +++ b/src/modules/filesystem/wrap_Filesystem.cpp @@ -720,7 +720,7 @@ static void replaceAll(std::string &str, const std::string &substr, const std::s int loader(lua_State *L) { - std::string modulename = luax_tostring(L, 1); + std::string modulename = luax_checkstring(L, 1); for (char &c : modulename) { @@ -761,7 +761,7 @@ static const char *library_extensions[] = int extloader(lua_State *L) { - const char *filename = lua_tostring(L, -1); + std::string filename = luax_checkstring(L, 1); std::string tokenized_name(filename); std::string tokenized_function(filename);