From 8dfdb3fa112544c52fa86ec46e05c4d0eaab6a92 Mon Sep 17 00:00:00 2001
From: emersion <contact@emersion.fr>
Date: Wed, 6 Mar 2019 10:47:50 +0100
Subject: [PATCH] Fix container_parent_layout for scratchpad windows

---
 sway/tree/container.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/sway/tree/container.c b/sway/tree/container.c
index 330439411..a6142193f 100644
--- a/sway/tree/container.c
+++ b/sway/tree/container.c
@@ -1163,7 +1163,10 @@ enum sway_container_layout container_parent_layout(struct sway_container *con) {
 	if (con->parent) {
 		return con->parent->layout;
 	}
-	return con->workspace->layout;
+	if (con->workspace) {
+		return con->workspace->layout;
+	}
+	return L_NONE;
 }
 
 enum sway_container_layout container_current_parent_layout(