`empty?` cannot happen as you check previous that current desktop is not empty, so find ( or select.first ) return nil

so code can be simple `if !selected_desktop`