Fix movetab and focusurgent when there's no client
Accessing those would crash with a floating point exception.
This commit is contained in:
parent
05f583c519
commit
6dc3978edf
8
tabbed.c
8
tabbed.c
|
@ -502,6 +502,9 @@ focusurgent(const Arg *arg)
|
||||||
{
|
{
|
||||||
int c;
|
int c;
|
||||||
|
|
||||||
|
if (sel < 0)
|
||||||
|
return;
|
||||||
|
|
||||||
for (c = (sel + 1) % nclients; c != sel; c = (c + 1) % nclients) {
|
for (c = (sel + 1) % nclients; c != sel; c = (c + 1) % nclients) {
|
||||||
if (clients[c]->urgent) {
|
if (clients[c]->urgent) {
|
||||||
focus(c);
|
focus(c);
|
||||||
|
@ -785,11 +788,14 @@ movetab(const Arg *arg)
|
||||||
int c;
|
int c;
|
||||||
Client *new;
|
Client *new;
|
||||||
|
|
||||||
|
if (sel < 0)
|
||||||
|
return;
|
||||||
|
|
||||||
c = (sel + arg->i) % nclients;
|
c = (sel + arg->i) % nclients;
|
||||||
if (c < 0)
|
if (c < 0)
|
||||||
c += nclients;
|
c += nclients;
|
||||||
|
|
||||||
if (sel < 0 || c == sel)
|
if (c == sel)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
new = clients[sel];
|
new = clients[sel];
|
||||||
|
|
Loading…
Reference in a new issue