Fix File:getSize crashing for a non-existent file

This commit is contained in:
Bart van Strien
2011-08-06 14:44:49 +02:00
parent 0d1da828b6
commit fdc56e7e73
2 changed files with 9 additions and 1 deletions
+8 -1
View File
@@ -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;
}