fixnpe
authorChristian Grothoff <christian@grothoff.org>
Thu, 4 Aug 2011 10:52:24 +0000 (10:52 +0000)
committerChristian Grothoff <christian@grothoff.org>
Thu, 4 Aug 2011 10:52:24 +0000 (10:52 +0000)
src/fs/gnunet-service-fs_pr.c

index 4db3505dd1b4e5215193e7c517ed35f83047e0fa..d3ea241a566df1ffcd3df803848a9b7a4b1b6edd 100644 (file)
@@ -997,8 +997,9 @@ put_migration_continuation (void *cls,
     }
   GNUNET_free (pmc);
   /* FIXME: should we really update the load value on failure? */
-  GNUNET_LOAD_update (datastore_put_load,
-                     delay.rel_value);
+  if (NULL != datastore_put_load)
+    GNUNET_LOAD_update (datastore_put_load,
+                       delay.rel_value);
   if (GNUNET_OK == success)
     return;
   GNUNET_STATISTICS_update (GSF_stats,
@@ -1021,6 +1022,8 @@ test_put_load_too_high (uint32_t priority)
 {
   double ld;
 
+  if (NULL == datastore_put_load)
+    return GNUNET_NO;
   if (GNUNET_LOAD_get_average (datastore_put_load) < 50)
     return GNUNET_NO; /* very fast */
   ld = GNUNET_LOAD_get_load (datastore_put_load);