From c073de8d26fe98bcd558b1da1700531ed21f9c78 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Ingo=20B=C3=BCrk?= Date: Wed, 1 Jul 2015 11:47:55 +0200 Subject: [PATCH] Remove asserts and return non-match instead if the container or its workspace cannot be found. This can cause an issue if used in combination with for_window and i3bar during startup of i3 otherwise. fixes #1774 --- src/match.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/match.c b/src/match.c index 03a9cbee..b95cf234 100644 --- a/src/match.c +++ b/src/match.c @@ -175,10 +175,12 @@ bool match_matches_window(Match *match, i3Window *window) { } if (match->workspace != NULL) { - Con *con = con_by_window_id(window->id); - assert(con != NULL); + if ((con = con_by_window_id(window->id)) == NULL) + return false; + Con *ws = con_get_workspace(con); - assert(ws != NULL); + if (ws == NULL) + return false; if (regex_matches(match->workspace, ws->name)) { LOG("workspace matches (%s)\n", ws->name); -- 2.39.2