From 3330faded5ed59b19b2a1982bb52c05322b03510 Mon Sep 17 00:00:00 2001 From: Brian Ashworth Date: Tue, 12 Mar 2019 13:57:40 -0400 Subject: Handle seat_get_focused_workspace returning NULL This modifiers the callers of seat_get_focused_workspace to handle getting NULL as the return value, if they did not already. --- sway/tree/root.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'sway/tree/root.c') diff --git a/sway/tree/root.c b/sway/tree/root.c index 6e13d6ce..0744192b 100644 --- a/sway/tree/root.c +++ b/sway/tree/root.c @@ -96,6 +96,10 @@ void root_scratchpad_remove_container(struct sway_container *con) { void root_scratchpad_show(struct sway_container *con) { struct sway_seat *seat = input_manager_current_seat(); struct sway_workspace *new_ws = seat_get_focused_workspace(seat); + if (!new_ws) { + sway_log(SWAY_DEBUG, "No focused workspace to show scratchpad on"); + return; + } struct sway_workspace *old_ws = con->workspace; // If the current con or any of its parents are in fullscreen mode, we -- cgit v1.2.3-54-g00ecf