summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--platform/gl/gl-main.c6
-rw-r--r--source/html/epub-doc.c1
2 files changed, 6 insertions, 1 deletions
diff --git a/platform/gl/gl-main.c b/platform/gl/gl-main.c
index 5cff5c3b..f708c760 100644
--- a/platform/gl/gl-main.c
+++ b/platform/gl/gl-main.c
@@ -590,7 +590,11 @@ static void do_links(fz_link *link, int xofs, int yofs)
open_browser(link->uri);
else
{
- jump_to_page(fz_resolve_link(ctx, doc, link->uri, NULL, NULL));
+ int p = fz_resolve_link(ctx, doc, link->uri, NULL, NULL);
+ if (p >= 0)
+ jump_to_page(p);
+ else
+ fz_warn(ctx, "cannot find link destination '%s'", link->uri);
ui_needs_update = 1;
}
}
diff --git a/source/html/epub-doc.c b/source/html/epub-doc.c
index 6c776bfa..ed52484c 100644
--- a/source/html/epub-doc.c
+++ b/source/html/epub-doc.c
@@ -59,6 +59,7 @@ epub_resolve_link(fz_context *ctx, fz_document *doc_, const char *dest, float *x
if (yp) *yp = y - page * ch->page_h;
return ch->start + page;
}
+ return -1;
}
return ch->start;
}