summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Rasmussen <sebras@gmail.com>2014-05-01 17:47:30 +0200
committerSebastian Rasmussen <sebras@gmail.com>2014-05-02 14:53:34 +0200
commit49ca600c6ec7d2409feef7f4590b7a6586a90eed (patch)
tree61cbcb868023144462eb71a270042fbc53c2e748
parent664e91bb592444aff59d69216d9adb53cebbc98c (diff)
downloadmupdf-49ca600c6ec7d2409feef7f4590b7a6586a90eed.tar.xz
Print error when trying to open document without any pages
-rw-r--r--platform/x11/pdfapp.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/platform/x11/pdfapp.c b/platform/x11/pdfapp.c
index 6109d601..c59d44d0 100644
--- a/platform/x11/pdfapp.c
+++ b/platform/x11/pdfapp.c
@@ -281,6 +281,8 @@ void pdfapp_open_progressive(pdfapp_t *app, char *filename, int reload, int bps)
fz_try(ctx)
{
app->pagecount = fz_count_pages(app->doc);
+ if (app->pagecount <= 0)
+ fz_throw(ctx, FZ_ERROR_GENERIC, "No pages in document");
}
fz_catch(ctx)
{