diff --git a/sway/debug_log.c b/sway/debug_log.c index 5cc5f9dca..166c41e84 100644 --- a/sway/debug_log.c +++ b/sway/debug_log.c @@ -71,11 +71,11 @@ void layout_log(const swayc_t *c, int depth) { layout_log(c->floating->items[i], depth + 1); } } - } - if (c->type == C_ROOT) { - fprintf(stderr,"ScratchPad\n"); - for (int i = 0; i < scratchpad->length; ++i) + } else if (c->type == C_ROOT && scratchpad->length > 0) { + fprintf(stderr, "ScratchPad\n"); + for (i = 0; i < scratchpad->length; ++i) { container_log(scratchpad->items[i], 0); + } } }