Don't try to access the focused desktop of NULL

This commit is contained in:
Bastien Dejean 2013-10-29 14:23:58 +01:00
parent 25b3086e0a
commit 6829eede5c

View file

@ -282,9 +282,11 @@ bool monitor_from_desc(char *desc, coordinates_t *ref, coordinates_t *dst)
} else if (streq("last", desc)) {
history_find_monitor(HISTORY_OLDER, ref, dst, sel);
} else if (streq("primary", desc)) {
coordinates_t loc = {pri_mon, pri_mon->desk, NULL};
if (pri_mon != NULL && desktop_matches(&loc, ref, sel))
dst->monitor = pri_mon;
if (pri_mon != NULL) {
coordinates_t loc = {pri_mon, pri_mon->desk, NULL};
if (desktop_matches(&loc, ref, sel))
dst->monitor = pri_mon;
}
} else if (streq("focused", desc)) {
coordinates_t loc = {mon, mon->desk, NULL};
if (desktop_matches(&loc, ref, sel))