modules: Make luci-base sufficient to use luci apps
[project/luci.git] / modules / luci-base / luasrc / dispatcher.lua
index 6cf2712eb4a862c8771ce68d7d34fe966e9ce68e..09d5d7284664a7e546810cc5b6a1d2d141aca469 100644 (file)
@@ -741,11 +741,12 @@ function _firstchild()
          end
    end
 
-   assert(lowest ~= nil,
-                 "The requested node contains no childs, unable to redispatch")
-
-   path[#path+1] = lowest
-   dispatch(path)
+   if lowest == nil then
+       require "luci.template".render("empty_node_placeholder")
+   else
+       path[#path+1] = lowest
+       dispatch(path)
+   end
 end
 
 function firstchild()