summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--xmake/core/package/package.lua8
1 files changed, 5 insertions, 3 deletions
diff --git a/xmake/core/package/package.lua b/xmake/core/package/package.lua
index 94dd88b61..11db68e0d 100644
--- a/xmake/core/package/package.lua
+++ b/xmake/core/package/package.lua
@@ -993,9 +993,11 @@ end
-- end
function _instance:has_tool(toolkind, ...)
local _, toolname = self:tool(toolkind)
- for _, v in ipairs(table.join(...)) do
- if v and toolname:find("^" .. v:gsub("%-", "%%-") .. "$") then
- return true
+ if toolname then
+ for _, v in ipairs(table.join(...)) do
+ if v and toolname:find("^" .. v:gsub("%-", "%%-") .. "$") then
+ return true
+ end
end
end
end