From dd6eee15429405b51a7cb9bd63a9312ebf70c6be Mon Sep 17 00:00:00 2001 From: Adam Date: Thu, 20 Oct 2022 18:04:28 -0400 Subject: [PATCH] Fixed the common idiom of setting a plugin to true. (#1152) --- data/core/config.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/data/core/config.lua b/data/core/config.lua index 87837439..b6007c0a 100644 --- a/data/core/config.lua +++ b/data/core/config.lua @@ -56,8 +56,9 @@ config.plugins = {} -- Allow you to set plugin configs even if we haven't seen the plugin before. setmetatable(config.plugins, { __index = function(t, k) - if rawget(t, k) == nil then rawset(t, k, {}) end - return rawget(t, k) + local v = rawget(t, k) + if v == true or v == nil then v = {} rawset(t, k, v) end + return v end })