Don't cancel if we didn't start watching anything in the first place
authorLRN <lrn1986@gmail.com>
Wed, 11 Sep 2013 13:38:24 +0000 (13:38 +0000)
committerLRN <lrn1986@gmail.com>
Wed, 11 Sep 2013 13:38:24 +0000 (13:38 +0000)
src/statistics/gnunet-statistics.c

index b1a447cf3e8667313cf999c481e477c5b0946897..2de58a0701a93e568616ed3aba74ee3dbd396a44 100644 (file)
@@ -162,8 +162,9 @@ shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
 
   if (NULL == h)
     return;
-  GNUNET_assert (GNUNET_OK ==
-                GNUNET_STATISTICS_watch_cancel (h, subsystem, name, &printer, h));
+  if (NULL != subsystem && NULL != name)
+    GNUNET_assert (GNUNET_OK ==
+        GNUNET_STATISTICS_watch_cancel (h, subsystem, name, &printer, h));
   GNUNET_STATISTICS_destroy (h, GNUNET_NO);
   h = NULL;  
 }