Browse Source

Fix an assertion failure introduced by #25948

Apparently, we can decide our state is dirty before we create the
event to tell the mainloop that we should save it.  That's not a
problem, except for the assertion failure.
Nick Mathewson 7 years ago
parent
commit
bbf0b92b1c
1 changed files with 4 additions and 1 deletions
  1. 4 1
      src/or/main.c

+ 4 - 1
src/or/main.c

@@ -2022,7 +2022,10 @@ save_state_callback(time_t now, const or_options_t *options)
 void
 reschedule_or_state_save(void)
 {
-  tor_assert(save_state_event);
+  if (save_state_event == NULL) {
+    /* This can happen early on during startup. */
+    return;
+  }
   periodic_event_reschedule(save_state_event);
 }