projects
/
project
/
luci.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
d409dd6
)
libs/web: fix possible dispatcher crash
author
Jo-Philipp Wich
<jow@openwrt.org>
Wed, 26 Oct 2011 03:04:41 +0000
(
03:04
+0000)
committer
Jo-Philipp Wich
<jow@openwrt.org>
Wed, 26 Oct 2011 03:04:41 +0000
(
03:04
+0000)
libs/web/luasrc/dispatcher.lua
patch
|
blob
|
history
diff --git
a/libs/web/luasrc/dispatcher.lua
b/libs/web/luasrc/dispatcher.lua
index b1ed62b82fc246e11b30249008f936f092dcadc5..fa78b2f6539fe88ec8b29c9a68d3cd90151c075c 100644
(file)
--- a/
libs/web/luasrc/dispatcher.lua
+++ b/
libs/web/luasrc/dispatcher.lua
@@
-92,18
+92,21
@@
end
-- @param node Dispatch node
-- @return Ordered table of child node names
function node_childs(node)
-- @param node Dispatch node
-- @return Ordered table of child node names
function node_childs(node)
- local rv = { }
- local k, v
- for k, v in util.spairs(node.nodes,
- function(a, b)
- return (node.nodes[a].order or 100) < (node.nodes[b].order or 100)
- end)
- do
- if node_visible(v) then
- rv[#rv+1] = k
- end
- end
- return rv
+ local rv = { }
+ if node then
+ local k, v
+ for k, v in util.spairs(node.nodes,
+ function(a, b)
+ return (node.nodes[a].order or 100)
+ < (node.nodes[b].order or 100)
+ end)
+ do
+ if node_visible(v) then
+ rv[#rv+1] = k
+ end
+ end
+ end
+ return rv
end
end