diff options
| -rw-r--r-- | xmake/core/sandbox/modules/import/lib/detect/cache.lua | 9 |
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 |
