mirror of
https://github.com/love2d/love.git
synced 2026-08-16 00:02:12 +02:00
Fix File:getSize crashing for a non-existent file
This commit is contained in:
@@ -37,7 +37,14 @@ namespace physfs
|
||||
int w_File_getSize(lua_State * L)
|
||||
{
|
||||
File * t = luax_checkfile(L, 1);
|
||||
lua_pushinteger(L, t->getSize());
|
||||
try
|
||||
{
|
||||
lua_pushinteger(L, t->getSize());
|
||||
}
|
||||
catch (Exception & e)
|
||||
{
|
||||
return luaL_error(L, e.what());
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user