]> git.sur5r.net Git - i3/i3/blobdiff - src/match.c
Remove asserts and return non-match instead if the container or its workspace cannot...
[i3/i3] / src / match.c
index 03a9cbee32c161f1c98b931e437abe0b93d6ab7b..b95cf2342bf61bbebdd90c7aebb5c4e9de89e39d 100644 (file)
@@ -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);