[gtk+/filesystemmodel] make the get_value function NULL-safe



commit 3b7c702726c333d94df97dda3197deff59436173
Author: Benjamin Otte <otte gnome org>
Date:   Wed Jun 24 22:52:32 2009 +0200

    make the get_value function NULL-safe

 gtk/gtkfilechooserdefault.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/gtk/gtkfilechooserdefault.c b/gtk/gtkfilechooserdefault.c
index d3b4b78..1deb48e 100644
--- a/gtk/gtkfilechooserdefault.c
+++ b/gtk/gtkfilechooserdefault.c
@@ -6787,10 +6787,10 @@ file_system_model_set (GtkFileSystemModel *model,
         g_value_set_object (value, NULL);
       break;
     case MODEL_COL_SIZE:
-      g_value_set_int64 (value, g_file_info_get_size (info));
+      g_value_set_int64 (value, info ? g_file_info_get_size (info) : 0);
       break;
     case MODEL_COL_SIZE_TEXT:
-      if (_gtk_file_info_consider_as_directory (info))
+      if (info == NULL || _gtk_file_info_consider_as_directory (info))
         g_value_set_string (value, NULL);
       else
         g_value_take_string (value, g_format_size_for_display (g_file_info_get_size (info)));



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