From 64a7ec51ff00af5ad0f26a469163867e5429ebc8 Mon Sep 17 00:00:00 2001 From: Timur Sultanov Date: Sun, 15 Mar 2020 01:31:23 +0300 Subject: [PATCH] Fixed crash if there is no windows to display --- src/layout.zig | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/layout.zig b/src/layout.zig index 76797e9..1f7aae9 100644 --- a/src/layout.zig +++ b/src/layout.zig @@ -167,6 +167,8 @@ pub const Layout = struct { } fn layout(self: *Layout) !void { + if (self.children.len == 0) return; + for (self.children.span()) |*child| { child.*.box.*.window.hide(); }