[plugin] OPDS: prevent crash if link.type is nil (#8111)

It can happen… somewhere, while clicking around http://arxiv.maplepop.com/catalog a bit. (The magical crash/bug finder from <https://github.com/koreader/koreader/issues/3023>.)
reviewable/pr8113/r1
Frans de Jonge 3 years ago committed by GitHub
parent f1b1d14fab
commit 04d1d23c2f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -440,7 +440,7 @@ function OPDSBrowser:genItemTableFromCatalog(catalog, item_url, username, passwo
item.acquisitions = {}
if entry.link then
for _, link in ipairs(entry.link) do
if link.type:find(self.catalog_type)
if link.type and link.type:find(self.catalog_type)
and (not link.rel
or link.rel == "subsection"
or link.rel == "http://opds-spec.org/subsection"

Loading…
Cancel
Save