Fix null pointer crash when lua script fails to load.

This commit is contained in:
Brad Smith 2018-11-12 17:33:42 -05:00 committed by GitHub
parent 717153ac19
commit 349aed4aaf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -6015,7 +6015,8 @@ int FCEU_LoadLuaCode(const char *filename, const char *arg) {
#endif
// Wipe the stack. Our thread
lua_settop(L,0);
if (L)
lua_settop(L,0);
return 0; // Oh shit.
}
#ifdef WIN32