]> git.mdlowis.com Git - proto/labwc.git/commitdiff
src/output.c: prevent crash with no outputs available
authorConsolatis <35009135+Consolatis@users.noreply.github.com>
Mon, 26 Dec 2022 22:09:33 +0000 (23:09 +0100)
committerJohan Malm <johanmalm@users.noreply.github.com>
Tue, 3 Jan 2023 19:46:31 +0000 (19:46 +0000)
src/output.c

index bd154de06ea95e295e3bcca6df7493b46489f0d8..efbdcdd8022eb49c5ddf4413042e94da521391e2 100644 (file)
@@ -434,6 +434,9 @@ output_from_wlr_output(struct server *server, struct wlr_output *wlr_output)
 struct wlr_box
 output_usable_area_in_layout_coords(struct output *output)
 {
+       if (!output) {
+               return (struct wlr_box){0};
+       }
        struct wlr_box box = output->usable_area;
        double ox = 0, oy = 0;
        wlr_output_layout_output_coords(output->server->output_layout,