Now init is safe from terminating

This commit is contained in:
Ale32bit 2016-10-30 21:47:53 +01:00 committed by GitHub
parent 14e3d9e37f
commit 56c385d13f

View file

@ -1,3 +1,5 @@
local old = os.pullEvent
os.pullEvent = os.pullEventRaw
local function crash(err) local function crash(err)
if not sPhone then if not sPhone then
sPhone = { sPhone = {
@ -189,6 +191,8 @@ if argData["-s"] then
runningOnStartup = true runningOnStartup = true
end end
os.pullEvent = old
local ok, err = pcall(function() setfenv(loadstring(script),getfenv())() end) local ok, err = pcall(function() setfenv(loadstring(script),getfenv())() end)
if not ok then if not ok then