Skip to content

Commit e5a01fd

Browse files
committed
not attached when there is no active app
1 parent 3a78f9c commit e5a01fd

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/textual/message_pump.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,10 @@ def app(self) -> "App[object]":
237237
@property
238238
def is_attached(self) -> bool:
239239
"""Is this node linked to the app through the DOM?"""
240-
if self.app._exit:
240+
try:
241+
if self.app._exit:
242+
return False
243+
except NoActiveAppError:
241244
return False
242245
node: MessagePump | None = self
243246
while (node := node._parent) is not None:

0 commit comments

Comments
 (0)