From 42fe08d7834df4ef2c12af9f78d14f606dc4651d Mon Sep 17 00:00:00 2001 From: Guus Sliepen Date: Tue, 21 Apr 2020 23:33:47 +0200 Subject: [PATCH] Avoid a crash when graph() is called when the event loop is not running. --- src/graph.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/graph.c b/src/graph.c index 050acbf5..c6e413d4 100644 --- a/src/graph.c +++ b/src/graph.c @@ -228,7 +228,7 @@ static void check_reachability(meshlink_handle_t *mesh) { if(!reachable) { mesh->last_unreachable = mesh->loop.now.tv_sec; - if(mesh->threadstarted) { + if(mesh->threadstarted && mesh->periodictimer.cb) { timeout_set(&mesh->loop, &mesh->periodictimer, &(struct timespec) { 0, prng(mesh, TIMER_FUDGE) }); -- 2.39.2