luci-base: don't fail getInitList if no indexes can be determined
authorJo-Philipp Wich <jo@mein.io>
Mon, 26 Sep 2022 08:46:00 +0000 (10:46 +0200)
committerJo-Philipp Wich <jo@mein.io>
Mon, 24 Oct 2022 23:03:37 +0000 (01:03 +0200)
Gracefully handle missing indexes in the luci rpcd plugin getInitList
procedure.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
modules/luci-base/root/usr/share/rpcd/ucode/luci

index 794676abc61586c14f3141b5fa223e0cb34f9453..cb00ff86d41464f0862aaf0b78dc14d3f7be7c65 100644 (file)
@@ -26,8 +26,8 @@ const methods = {
                                let idx = init_index(name);
 
                                scripts[name] = {
-                                       index: idx[0],
-                                       stop: idx[1],
+                                       index: idx?.[0],
+                                       stop: idx?.[1],
                                        enabled: init_enabled(name)
                                };
                        }