From dcc08346a29bcb40ec1e8af23c3920c8adea4796 Mon Sep 17 00:00:00 2001 From: rxi Date: Tue, 4 Mar 2014 12:35:35 +0000 Subject: [PATCH] Fixed lume.hotswap() to handle nonexistent modules properly --- lume.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lume.lua b/lume.lua index a8313b9..c9512ec 100644 --- a/lume.lua +++ b/lume.lua @@ -263,7 +263,7 @@ function lume.hotswap(modname) if type(v) == "table" then update(old[k], v) else old[k] = v end end end - local oldmod = require(modname) + local oldmod = pcall(require, modname) or nil local err = nil local function onerror(e) for k, v in pairs(_G) do _G[k] = oldglobal[k] end