summaryrefslogtreecommitdiff
path: root/xmake/core/base/task.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2025-01-12 21:27:13 +0800
committerruki <[email protected]>2025-01-12 21:27:13 +0800
commit543fa337184df181eae18b35eb8f80c125ab8a84 (patch)
treedf9a70fea3cec29276a389fda86983c761ad16ac /xmake/core/base/task.lua
parent5bc5ce579fe5af900fc5dd653dfde7be486ea9a1 (diff)
fix errors for apis
Diffstat (limited to 'xmake/core/base/task.lua')
-rw-r--r--xmake/core/base/task.lua12
1 files changed, 7 insertions, 5 deletions
diff --git a/xmake/core/base/task.lua b/xmake/core/base/task.lua
index a3fde1913..b792c3637 100644
--- a/xmake/core/base/task.lua
+++ b/xmake/core/base/task.lua
@@ -368,11 +368,13 @@ end
-- new a task instance
function task.new(name, info)
local instance = table.inherit(task)
- local parts = name:split("::", {plain = true})
- instance._NAME = parts[#parts]
- table.remove(parts)
- if #parts > 0 then
- instance._NAMESPACE = table.concat(parts, "::")
+ if name then
+ local parts = name:split("::", {plain = true})
+ instance._NAME = parts[#parts]
+ table.remove(parts)
+ if #parts > 0 then
+ instance._NAMESPACE = table.concat(parts, "::")
+ end
end
instance._INFO = info
return instance