From 62d45da4a5bf967deb84472bdbb1b63dacae1b97 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Mon, 11 Oct 2021 19:01:39 +0200 Subject: [PATCH] luci-base: dispatcher: fix null access on dispatching unknown urls Signed-off-by: Jo-Philipp Wich (cherry picked from commit 4d28c390ab181636b101a17203b2db3391784687) --- modules/luci-base/luasrc/dispatcher.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/luci-base/luasrc/dispatcher.lua b/modules/luci-base/luasrc/dispatcher.lua index 44c17c85f8..3c1d438f34 100644 --- a/modules/luci-base/luasrc/dispatcher.lua +++ b/modules/luci-base/luasrc/dispatcher.lua @@ -920,7 +920,9 @@ function dispatch(request) return end - page.readonly = not perm + if page then + page.readonly = not perm + end end local action = (page and type(page.action) == "table") and page.action or {}