From 6cc97e85489f5e4e39aa185d17ad5e35b09dddb5 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Fri, 13 Feb 2015 12:16:06 +0100 Subject: Remove pointless return value checks when calling fz_open_file. fz_open_file does not return NULL on failure -- it throws an exception! --- source/xps/xps-zip.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'source/xps') diff --git a/source/xps/xps-zip.c b/source/xps/xps-zip.c index ab8c60d7..3759c4b6 100644 --- a/source/xps/xps-zip.c +++ b/source/xps/xps-zip.c @@ -182,21 +182,14 @@ xps_open_document(fz_context *ctx, const char *filename) } file = fz_open_file(ctx, filename); - if (!file) - fz_throw(ctx, FZ_ERROR_GENERIC, "cannot open file '%s': %s", filename, strerror(errno)); fz_try(ctx) - { doc = xps_open_document_with_stream(ctx, file); - } fz_always(ctx) - { fz_drop_stream(ctx, file); - } fz_catch(ctx) - { fz_rethrow_message(ctx, "cannot load document '%s'", filename); - } + return doc; } -- cgit v1.2.3