summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2017-06-28 16:56:47 +0800
committerruki <[email protected]>2017-06-28 16:56:47 +0800
commitc45a4613ce40f939b52c2ccd883712ff30d54dcc (patch)
tree220ac2facfd6805951970f3ff19df30c507ad463
parent4f19017e0c4c1b0e383819768e6ed47230be21fc (diff)
fix detect cache bug
-rw-r--r--xmake/core/sandbox/modules/import/lib/detect/cache.lua9
1 files changed, 8 insertions, 1 deletions
diff --git a/xmake/core/sandbox/modules/import/lib/detect/cache.lua b/xmake/core/sandbox/modules/import/lib/detect/cache.lua
index c3a890de1..82d9c60bc 100644
--- a/xmake/core/sandbox/modules/import/lib/detect/cache.lua
+++ b/xmake/core/sandbox/modules/import/lib/detect/cache.lua
@@ -57,7 +57,14 @@ function sandbox_lib_detect_cache.load(name)
local detectcache = sandbox_lib_detect_cache._instance()
-- attempt to get result from cache first
- return detectcache:get(name) or {}
+ local cacheinfo = detectcache:get(name)
+ if cacheinfo == nil then
+ cacheinfo = {}
+ detectcache:set(name, cacheinfo)
+ end
+
+ -- ok?
+ return cacheinfo
end
-- save detect cache