From 913445e112b3ceca4ece731a6e57b19cab9d0c6a Mon Sep 17 00:00:00 2001 From: Ashkan Kiani Date: Sat, 13 Apr 2019 03:33:07 -0700 Subject: Fix potential null accesses --- sway/input/seat.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'sway/input') diff --git a/sway/input/seat.c b/sway/input/seat.c index d58ff9e6..bdab8b81 100644 --- a/sway/input/seat.c +++ b/sway/input/seat.c @@ -1194,11 +1194,13 @@ void seat_consider_warp_to_focus(struct sway_seat *seat) { } if (config->mouse_warping == WARP_OUTPUT) { struct sway_output *output = node_get_output(focus); - struct wlr_box box; - output_get_box(output, &box); - if (wlr_box_contains_point(&box, - seat->cursor->cursor->x, seat->cursor->cursor->y)) { - return; + if (output) { + struct wlr_box box; + output_get_box(output, &box); + if (wlr_box_contains_point(&box, + seat->cursor->cursor->x, seat->cursor->cursor->y)) { + return; + } } } -- cgit v1.2.3