[Xfce4-commits] <postler:master> Fix crash caused by incorrect handling of invalid date

Christian Dywan noreply at xfce.org
Mon Feb 21 19:28:01 CET 2011


Updating branch refs/heads/master
         to b181744e2b0e9a18315f2d090af72c086370b6fc (commit)
       from 97809db78e45b8ddf15ddad5a30e0678d15a7c71 (commit)

commit b181744e2b0e9a18315f2d090af72c086370b6fc
Author: Christian Dywan <christian at twotoasts.de>
Date:   Mon Feb 21 18:41:49 2011 +0100

    Fix crash caused by incorrect handling of invalid date

 postler/postler-content.vala |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/postler/postler-content.vala b/postler/postler-content.vala
index 56cf431..bed6d20 100644
--- a/postler/postler-content.vala
+++ b/postler/postler-content.vala
@@ -444,9 +444,12 @@ public class Postler.Content : WebKit.WebView {
     internal static DateTime date_from_string (string date) {
         var parsed = new Soup.Date.from_string (date);
         TimeVal time = new TimeVal ();
-        if (parsed != null)
+        int offset = 0;
+        if (parsed != null) {
             parsed.to_timeval (time);
-        return new DateTime.from_timeval_local (time).add_minutes (parsed.offset);
+            offset = parsed.offset;
+        }
+        return new DateTime.from_timeval_local (time).add_minutes (offset);
     }
 
     public void prepare_reply (string? location, AccountInfo account_info,



More information about the Xfce4-commits mailing list