luci-app-dockerman: gracefully handle empty registry mirror setting
authorJo-Philipp Wich <jo@mein.io>
Fri, 28 Apr 2023 21:43:31 +0000 (23:43 +0200)
committerJo-Philipp Wich <jo@mein.io>
Fri, 28 Apr 2023 21:43:58 +0000 (23:43 +0200)
Fixes: #6300
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
applications/luci-app-dockerman/luasrc/model/cbi/dockerman/overview.lua

index dd4828b34f64fc620de475ff3cd96f0e7b43272c..022664738d347b4593d0f8967eed4d7c0c040449 100644 (file)
@@ -65,7 +65,7 @@ if docker.new():_ping().code == 200 then
        end
 
        docker_info_table['8IndexServerAddress']._value = docker_info.body.IndexServerAddress
-       for i, v in ipairs(docker_info.body.RegistryConfig.Mirrors) do
+       for i, v in ipairs(docker_info.body.RegistryConfig.Mirrors or {}) do
                docker_info_table['9RegistryMirrors']._value = docker_info_table['9RegistryMirrors']._value == "-" and v or (docker_info_table['9RegistryMirrors']._value .. ", " .. v)
        end