[shotwell] Avoid soft assertion due to returned NULL when reading video timestamp



commit d431810d1730e540e227942df8ff2f9941429610
Author: Jim Nelson <jim yorba org>
Date:   Mon Dec 29 18:39:17 2014 -0800

    Avoid soft assertion due to returned NULL when reading video timestamp

 src/VideoSupport.vala |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/src/VideoSupport.vala b/src/VideoSupport.vala
index e23ba37..fc925b6 100644
--- a/src/VideoSupport.vala
+++ b/src/VideoSupport.vala
@@ -197,8 +197,11 @@ public class VideoReader {
             // (and the corresponding output struct) in order to implement #2836.
             Date? video_date = null;
             if (info.get_tags() != null && info.get_tags().get_date(Gst.Tags.DATE, out video_date)) {
-                timestamp = new DateTime.local(video_date.get_year(), video_date.get_month(), 
-                    video_date.get_day(), 0, 0, 0);
+                // possible for get_date() to return true and a null Date
+                if (video_date != null) {
+                    timestamp = new DateTime.local(video_date.get_year(), video_date.get_month(),
+                        video_date.get_day(), 0, 0, 0);
+                }
             }
         } catch (Error e) {
             debug("Video read error: %s", e.message);


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