From 1e0459f7f7a6a266f7c65ba638db3fe3f4a53635 Mon Sep 17 00:00:00 2001
From: Ryan Dwyer <ryandwyer1@gmail.com>
Date: Fri, 31 Aug 2018 19:49:12 +1000
Subject: [PATCH] Fix crash when running deferred commands

Fixes #2541
---
 sway/input/seat.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sway/input/seat.c b/sway/input/seat.c
index 36e1d232..6a6e3096 100644
--- a/sway/input/seat.c
+++ b/sway/input/seat.c
@@ -635,7 +635,7 @@ void seat_set_focus_warp(struct sway_seat *seat,
 
 	// find new output's old workspace, which might have to be removed if empty
 	struct sway_container *new_output_last_ws = NULL;
-	if (last_output != new_output) {
+	if (new_output && last_output != new_output) {
 		new_output_last_ws = seat_get_active_child(seat, new_output);
 	}