From c45a4613ce40f939b52c2ccd883712ff30d54dcc Mon Sep 17 00:00:00 2001 From: ruki Date: Wed, 28 Jun 2017 16:56:47 +0800 Subject: fix detect cache bug --- xmake/core/sandbox/modules/import/lib/detect/cache.lua | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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 -- cgit v1.3.1