Make luaError function return null to waiting javascript

This commit is contained in:
Malin Ejdbo
2021-05-31 15:35:26 +02:00
parent 31b834dbb2
commit 139d1f7dd5

View File

@@ -191,14 +191,23 @@ bool ScriptEngine::runScript(const std::string& script, ScriptCallback callback)
}
catch (const ghoul::lua::LuaLoadingException& e) {
LERRORC(e.component, e.message);
if (callback) {
callback(ghoul::Dictionary());
}
return false;
}
catch (const ghoul::lua::LuaExecutionException& e) {
LERRORC(e.component, e.message);
if (callback) {
callback(ghoul::Dictionary());
}
return false;
}
catch (const ghoul::RuntimeError& e) {
LERRORC(e.component, e.message);
if (callback) {
callback(ghoul::Dictionary());
}
return false;
}