From b07fa5cd043c047b78c2792ff5f1e4a34c7cbf1e Mon Sep 17 00:00:00 2001 From: Guido Günther Date: Sat, 4 Oct 2014 11:58:58 +0200 Subject: Don't crash on NULL arrival and departure datetime --- libplanfahr/lpf-stop.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libplanfahr/lpf-stop.c b/libplanfahr/lpf-stop.c index 5295fb4..3c733bc 100644 --- a/libplanfahr/lpf-stop.c +++ b/libplanfahr/lpf-stop.c @@ -196,8 +196,10 @@ lpf_stop_finalize (GObject *object) LpfStopPrivate *priv = GET_PRIVATE (self); GObjectClass *parent_class = G_OBJECT_CLASS (lpf_stop_parent_class); - g_date_time_unref (priv->dep); - g_date_time_unref (priv->arr); + if (priv->dep) + g_date_time_unref (priv->dep); + if (priv->arr) + g_date_time_unref (priv->arr); g_free (priv->name); g_free (priv->arr_plat); g_free (priv->dep_plat); -- cgit v1.2.3