diff options
author | Guido Günther <agx@sigxcpu.org> | 2014-10-04 11:58:58 +0200 |
---|---|---|
committer | Guido Günther <agx@sigxcpu.org> | 2014-10-04 11:58:58 +0200 |
commit | b07fa5cd043c047b78c2792ff5f1e4a34c7cbf1e (patch) | |
tree | c5e4a1e07f04d855185106aa4e3f6c15e151c1b2 | |
parent | 606a0e70806d7f22ebe3bbc39987f248ca74a17f (diff) |
Don't crash on NULL arrival and departure datetime
-rw-r--r-- | libplanfahr/lpf-stop.c | 6 |
1 files 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); |