[glabels/glabels-3_4] Prevent crash when providing an invalid file on the command line



commit c001d7c2ffd4142d72f26820bfd71dd3533780de
Author: Clemens Fries <githubert xenoworld de>
Date:   Wed Apr 27 21:54:24 2016 +0200

    Prevent crash when providing an invalid file on the command line

 src/window.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/src/window.c b/src/window.c
index ca39c4f..b9bfc1d 100644
--- a/src/window.c
+++ b/src/window.c
@@ -329,7 +329,9 @@ gl_window_new_from_file (const gchar *filename)
        label = gl_xml_label_open (abs_filename, &status);
        g_free (abs_filename);
 
-       gl_window_set_label (window, label);
+       if (label) {
+               gl_window_set_label (window, label);
+       }
 
        gl_debug (DEBUG_WINDOW, "END");
 


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