Skip to content

Commit

Permalink
Fix a Tabs crash
Browse files Browse the repository at this point in the history
  • Loading branch information
darrenburns committed Oct 16, 2023
1 parent d871c83 commit 710d6b5
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/textual/widgets/_tabs.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from __future__ import annotations

import asyncio
from asyncio import create_task
from dataclasses import dataclass
from typing import ClassVar

Expand All @@ -12,16 +11,15 @@
from .. import events
from ..app import ComposeResult, RenderResult
from ..await_complete import AwaitComplete
from ..await_remove import AwaitRemove
from ..binding import Binding, BindingType
from ..containers import Container, Horizontal, Vertical
from ..css.query import NoMatches
from ..events import Event, Mount
from ..events import Mount
from ..geometry import Offset
from ..message import Message
from ..reactive import reactive
from ..renderables.bar import Bar
from ..widget import AwaitMount, Widget
from ..widget import Widget
from ..widgets import Static


Expand Down Expand Up @@ -488,7 +486,7 @@ def remove_tab(self, tab_or_id: Tab | str | None) -> AwaitComplete:
Returns:
An optionally awaitable object that waits for the tab to be removed.
"""
if tab_or_id is None:
if not tab_or_id:
return AwaitComplete(self.app._remove_nodes([], None)())

if isinstance(tab_or_id, Tab):
Expand Down

0 comments on commit 710d6b5

Please sign in to comment.