瀏覽代碼

Test W->client in tag_client* uicbs

Martin Duquesnoy 12 年之前
父節點
當前提交
5508a565a1
共有 1 個文件被更改,包括 7 次插入1 次删除
  1. 7 1
      src/tag.c

+ 7 - 1
src/tag.c

@@ -181,7 +181,7 @@ uicb_tag_client(Uicb cmd)
      struct tag *t;
      int id = ATOI(cmd);
 
-     if((t = tag_gb_id(W->screen, id)))
+     if(W->client && (t = tag_gb_id(W->screen, id)))
           tag_client(t, W->client);
 }
 
@@ -191,6 +191,9 @@ uicb_tag_move_client_next(Uicb cmd)
      (void)cmd;
      struct tag *t;
 
+     if(!W->client)
+          return;
+
      if((t = TAILQ_NEXT(W->screen->seltag, next)))
           tag_client(t, W->client);
      else if( /* CIRCULAR OPTION */ 1)
@@ -203,6 +206,9 @@ uicb_tag_move_client_prev(Uicb cmd)
      (void)cmd;
      struct tag *t;
 
+     if(!W->client)
+          return;
+
      if((t = TAILQ_PREV(W->screen->seltag, tsub, next)))
           tag_client(t, W->client);
      else if( /* CIRCULAR OPTION */ 1)