diff options
Diffstat (limited to 'src/guitools.cs')
-rwxr-xr-x | src/guitools.cs | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/src/guitools.cs b/src/guitools.cs index 8828941..bdc9e8a 100755 --- a/src/guitools.cs +++ b/src/guitools.cs @@ -306,10 +306,19 @@ namespace gfax { bool is_sorted = ((Gtk.ListStore)model).GetSortColumnId (out col, out sort); if(!is_sorted) return 0; - - DateTime dateA = (DateTime)model.GetValue (a, col); - DateTime dateB = (DateTime)model.GetValue (b, col); - + + object oA = model.GetValue (a, col); + object oB = model.GetValue (b, col); + + if(oB == null) + return 1; + + if(oA == null) + return -1; + + DateTime dateA = (DateTime)oA; + DateTime dateB = (DateTime)oB; + return dateA.CompareTo(dateB); } |