mirror of
https://github.com/TangentFoxy/lume.git
synced 2024-11-19 07:04:24 +00:00
Fixed lume.hotswap() to handle nonexistent modules properly
This commit is contained in:
parent
fb64932134
commit
dcc08346a2
2
lume.lua
2
lume.lua
@ -263,7 +263,7 @@ function lume.hotswap(modname)
|
|||||||
if type(v) == "table" then update(old[k], v) else old[k] = v end
|
if type(v) == "table" then update(old[k], v) else old[k] = v end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
local oldmod = require(modname)
|
local oldmod = pcall(require, modname) or nil
|
||||||
local err = nil
|
local err = nil
|
||||||
local function onerror(e)
|
local function onerror(e)
|
||||||
for k, v in pairs(_G) do _G[k] = oldglobal[k] end
|
for k, v in pairs(_G) do _G[k] = oldglobal[k] end
|
||||||
|
Loading…
Reference in New Issue
Block a user