[gnome-commander] Add null-check when turning a date into a string



commit 253ff00cc6e6783305b94d85e012a35a1c81dead
Author: Uwe Scholz <u scholz83 gmx de>
Date:   Wed Jan 5 17:56:27 2022 +0100

    Add null-check when turning a date into a string

 src/gnome-cmd-file.cc | 2 ++
 1 file changed, 2 insertions(+)
---
diff --git a/src/gnome-cmd-file.cc b/src/gnome-cmd-file.cc
index 3bb504b4..3e5a5180 100644
--- a/src/gnome-cmd-file.cc
+++ b/src/gnome-cmd-file.cc
@@ -735,6 +735,8 @@ const gchar *GnomeCmdFile::get_group()
 
 inline const gchar *date2string (GDateTime *date, gboolean overide_disp_setting)
 {
+    if (!date) return nullptr;
+
     return time2string (date, overide_disp_setting ? "%c" : gnome_cmd_data.options.date_format);
 }
 


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