diff options
author | Ashkan Kiani <ashkan.k.kiani@gmail.com> | 2019-04-13 03:33:07 -0700 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2019-04-13 08:35:17 -0600 |
commit | 913445e112b3ceca4ece731a6e57b19cab9d0c6a (patch) | |
tree | 0de3cc6ffd2f7410a758547df31bd572363cf3a2 /sway/input | |
parent | e7d6b8ec3e88564617c6c05656548a37b5dc6d27 (diff) | |
download | sway-913445e112b3ceca4ece731a6e57b19cab9d0c6a.tar.xz |
Fix potential null accesses
Diffstat (limited to 'sway/input')
-rw-r--r-- | sway/input/seat.c | 12 |
1 files changed, 7 insertions, 5 deletions
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; + } } } |