[gnome-epub-thumbnailer] epub: Don't look for a NULL metafile



commit 267dcdf9b52088cae7789cb13c530fe2e0f90597
Author: Bastien Nocera <hadess hadess net>
Date:   Mon Sep 2 02:23:29 2013 +0200

    epub: Don't look for a NULL metafile
    
    It's useless doing so, and only leads to confusion.

 gnome-epub-thumbnailer.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/gnome-epub-thumbnailer.c b/gnome-epub-thumbnailer.c
index 1cb8149..20c81d9 100644
--- a/gnome-epub-thumbnailer.c
+++ b/gnome-epub-thumbnailer.c
@@ -263,6 +263,10 @@ file_to_data (const char  *path,
 
        /* Look for the cover in the metafile */
        metafile = file_get_zipped_contents (path, (GCompareFunc) g_strcmp0, "META-INF/container.xml", 
&length);
+       if (metafile == NULL) {
+               g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_FAILED, "Could not find 
META-INF/container.xml file");
+               return NULL;
+       }
        cover_path = get_cover_path_from_root_file (metafile, length, path);
        g_free (metafile);
        if (cover_path != NULL) {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]