diff options
author | Christian Grothoff <christian@grothoff.org> | 2010-03-19 13:21:31 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2010-03-19 13:21:31 +0000 |
commit | e98b0a89bb7a9b28a916cb8aa5cd7649c66e7b52 (patch) | |
tree | a013c4bcf1a05b812a5335efee485364311c9686 /src/statistics | |
parent | a3a4802b287a6ebe45f93920fae6343070168d4f (diff) | |
download | gnunet-e98b0a89bb7a9b28a916cb8aa5cd7649c66e7b52.tar.gz gnunet-e98b0a89bb7a9b28a916cb8aa5cd7649c66e7b52.zip |
tolerate NULL handle
Diffstat (limited to 'src/statistics')
-rw-r--r-- | src/statistics/statistics_api.c | 6 |
1 files changed, 6 insertions, 0 deletions
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, | |||
789 | const char *name, | 789 | const char *name, |
790 | uint64_t value, int make_persistent) | 790 | uint64_t value, int make_persistent) |
791 | { | 791 | { |
792 | if (handle == NULL) | ||
793 | return; | ||
792 | GNUNET_assert (GNUNET_NO == handle->do_destroy); | 794 | GNUNET_assert (GNUNET_NO == handle->do_destroy); |
793 | add_setter_action (handle, name, make_persistent, value, ACTION_SET); | 795 | add_setter_action (handle, name, make_persistent, value, ACTION_SET); |
794 | } | 796 | } |
@@ -808,6 +810,10 @@ GNUNET_STATISTICS_update (struct GNUNET_STATISTICS_Handle *handle, | |||
808 | const char *name, | 810 | const char *name, |
809 | int64_t delta, int make_persistent) | 811 | int64_t delta, int make_persistent) |
810 | { | 812 | { |
813 | if (handle == NULL) | ||
814 | return; | ||
815 | if (delta == 0) | ||
816 | return; | ||
811 | GNUNET_assert (GNUNET_NO == handle->do_destroy); | 817 | GNUNET_assert (GNUNET_NO == handle->do_destroy); |
812 | add_setter_action (handle, name, make_persistent, | 818 | add_setter_action (handle, name, make_persistent, |
813 | (unsigned long long) delta, ACTION_UPDATE); | 819 | (unsigned long long) delta, ACTION_UPDATE); |