diff --git a/base b/base index b6ca09e06..8f5f38d73 160000 --- a/base +++ b/base @@ -1 +1 @@ -Subproject commit b6ca09e06615df75f2219270a5e09d8ea331cd00 +Subproject commit 8f5f38d732bba170abdae5df015f9f4b475fac6e diff --git a/frontend/apps/reader/modules/readerlink.lua b/frontend/apps/reader/modules/readerlink.lua index da9f8faca..a28a5e182 100644 --- a/frontend/apps/reader/modules/readerlink.lua +++ b/frontend/apps/reader/modules/readerlink.lua @@ -1058,7 +1058,9 @@ function ReaderLink:onGoToPageLink(ges, internal_links_only, max_distance) for _, link in ipairs(links) do -- link.uri may be an empty string with some invalid links: ignore them if link.section or (link.uri and link.uri ~= "") then - if link.segments then + -- Note: we may get segments empty in some conditions (in which + -- case we'll fallback to the 'else' branch and using x/y) + if link.segments and #link.segments > 0 then -- With segments, each is a horizontal segment, with start_x < end_x, -- and we should compute the distance from gesture position to -- each segment.