diff options
| -rw-r--r-- | xmake/core/project/target.lua | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/xmake/core/project/target.lua b/xmake/core/project/target.lua index 88c3197eb..8ba375fb3 100644 --- a/xmake/core/project/target.lua +++ b/xmake/core/project/target.lua @@ -1993,9 +1993,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 |
