From e98b0a89bb7a9b28a916cb8aa5cd7649c66e7b52 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Fri, 19 Mar 2010 13:21:31 +0000 Subject: [PATCH] tolerate NULL handle --- src/statistics/statistics_api.c | 6 ++++++ 1 file changed, 6 insertions(+) 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); -- 2.25.1