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
This commit is contained in:
Ingo Bürk 2015-07-01 11:47:55 +02:00
parent 6be1b28813
commit c073de8d26
1 changed files with 5 additions and 3 deletions

View 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);