love.filesystem's loaders in the package.loaders table error instead of crashing when no argument is given to them (resolves issue #1504).

This commit is contained in:
Alex Szpakowski
2019-08-02 21:04:22 -03:00
parent 459d31db7e
commit 528c1e2390
+2 -2
View File
@@ -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);