Now init is safe from terminating
This commit is contained in:
parent
14e3d9e37f
commit
56c385d13f
1 changed files with 4 additions and 0 deletions
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue