diff --git a/src/kernel/connection.c b/src/kernel/connection.c index 5bccfafd6..eecbd6c59 100644 --- a/src/kernel/connection.c +++ b/src/kernel/connection.c @@ -117,9 +117,11 @@ void walk_connections(region *r, void(*cb)(connection *, void *), void *data) { walk_i(r, borders[key], cb, data); for (d = 0; d != MAXDIRECTIONS; ++d) { region *rn = r_connect(r, d); - int k = reg_hashkey(rn); - if (k < key) { - walk_i(r, borders[k], cb, data); + if (rn) { + int k = reg_hashkey(rn); + if (k < key) { + walk_i(r, borders[k], cb, data); + } } } }