From: Christian Grothoff Date: Fri, 19 Mar 2010 13:21:31 +0000 (+0000) Subject: tolerate NULL handle X-Git-Tag: initial-import-from-subversion-38251~22398 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=e98b0a89bb7a9b28a916cb8aa5cd7649c66e7b52;p=oweals%2Fgnunet.git tolerate NULL handle --- diff --git a/src/statistics/statistics_api.c b/src/statistics/statistics_api.c index 5c5588e91..48b038cfe 100644 --- a/src/statistics/statistics_api.c +++ b/src/statistics/statistics_api.c @@ -789,6 +789,8 @@ GNUNET_STATISTICS_set (struct GNUNET_STATISTICS_Handle *handle, const char *name, uint64_t value, int make_persistent) { + if (handle == NULL) + return; GNUNET_assert (GNUNET_NO == handle->do_destroy); add_setter_action (handle, name, make_persistent, value, ACTION_SET); } @@ -808,6 +810,10 @@ GNUNET_STATISTICS_update (struct GNUNET_STATISTICS_Handle *handle, const char *name, int64_t delta, int make_persistent) { + if (handle == NULL) + return; + if (delta == 0) + return; GNUNET_assert (GNUNET_NO == handle->do_destroy); add_setter_action (handle, name, make_persistent, (unsigned long long) delta, ACTION_UPDATE);