From c57daaf0d1640b45579d75ce9775b8c0d03299b7 Mon Sep 17 00:00:00 2001 From: Willow Barraco Date: Wed, 25 Feb 2026 07:42:24 +0100 Subject: [PATCH] Skip checking if criteria is matching the view when not mapped Multiple checks in this method use view->container, but it can be NULL at some points. Bail early to avoid crash. --- sway/criteria.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sway/criteria.c b/sway/criteria.c index 230f47a18..6be6e7042 100644 --- a/sway/criteria.c +++ b/sway/criteria.c @@ -196,6 +196,10 @@ static bool criteria_matches_view(struct criteria *criteria, struct sway_container *focus = seat_get_focused_container(seat); struct sway_view *focused = focus ? focus->view : NULL; + if (!view->container) { + return false; + } + if (criteria->title) { const char *title = view_get_title(view); if (!title) {