summaryrefslogtreecommitdiff
path: root/xmake/core/base/table.lua
diff options
context:
space:
mode:
authorA2va <[email protected]>2023-10-01 11:17:08 +0200
committerA2va <[email protected]>2023-10-01 11:17:08 +0200
commit85a605758c47eaa92b0a22b028cc4896eceeaf3f (patch)
tree7178d6a1d6b6ee2d9d55640b214f8ed38b1d1df0 /xmake/core/base/table.lua
parentdbfde8ed4da11fd0221a88bfa267e9cf05457345 (diff)
Check callback type
Diffstat (limited to 'xmake/core/base/table.lua')
-rw-r--r--xmake/core/base/table.lua1
1 files changed, 1 insertions, 0 deletions
diff --git a/xmake/core/base/table.lua b/xmake/core/base/table.lua
index 1f7576870..a8050f0a3 100644
--- a/xmake/core/base/table.lua
+++ b/xmake/core/base/table.lua
@@ -429,6 +429,7 @@ end
-- get order keys of a table
function table.orderkeys(tbl, callback)
+ local callback = type(callback) == "function" and callback or nil
local keys = table.keys(tbl)
table.sort(keys, callback)
return keys