[fix] OPDS crash with fewer than 4 servers (#5092)

Regression introduced in <https://github.com/koreader/koreader/pull/4249>.

Fixes <https://github.com/koreader/koreader/issues/5091>.
This commit is contained in:
Frans de Jonge
2019-06-25 19:50:01 +02:00
committed by GitHub
parent a791a7df56
commit fca51757af

View File

@@ -89,7 +89,7 @@ function OPDSBrowser:init()
},
}
G_reader_settings:saveSetting("opds_servers", servers)
elseif servers[4].title == "Internet Archive" and servers[4].url == "http://bookserver.archive.org/catalog/" then
elseif servers[4] and servers[4].title == "Internet Archive" and servers[4].url == "http://bookserver.archive.org/catalog/" then
servers[4].url = "https://bookserver.archive.org"
end
self.item_table = self:genItemTableFromRoot()