/* Is it just 's' for stacking or 'd' for default? */
if ((command[0] == 's' || command[0] == 'd') && (command[1] == '\0')) {
- if (last_focused->floating) {
+ if (last_focused == NULL || last_focused->floating) {
LOG("not switching, this is a floating client\n");
return;
}
}
if (*rest == '\0') {
- if (last_focused->floating)
+ if (last_focused != NULL && last_focused->floating)
move_floating_window_to_workspace(conn, last_focused, workspace);
else move_current_window_to_workspace(conn, workspace);
return;
}
- if (last_focused->floating) {
- LOG("Not performing because this is a floating window\n");
+ if (last_focused == NULL || last_focused->floating) {
+ LOG("Not performing (null or floating) \n");
return;
}