mirror of
https://github.com/GH05TCREW/pentestagent.git
synced 2026-03-07 14:23:20 +00:00
fix(tui): avoid mount_before AttributeError by falling back to mount
This commit is contained in:
@@ -1794,7 +1794,12 @@ class PentestAgentTUI(App):
|
||||
first = scroll.children[0] if scroll.children else None
|
||||
msg = SystemMessage(f" Target: {target}")
|
||||
if first:
|
||||
scroll.mount_before(msg, first)
|
||||
# Textual's ScrollableContainer may not implement
|
||||
# mount_before across versions; fall back to mount.
|
||||
try:
|
||||
scroll.mount_before(msg, first)
|
||||
except Exception:
|
||||
scroll.mount(msg)
|
||||
else:
|
||||
scroll.mount(msg)
|
||||
except Exception as e:
|
||||
@@ -2419,7 +2424,10 @@ Be concise. Use the actual data from notes."""
|
||||
first = scroll.children[0] if scroll.children else None
|
||||
msg = SystemMessage(f" Target: {target}")
|
||||
if first:
|
||||
scroll.mount_before(msg, first)
|
||||
try:
|
||||
scroll.mount_before(msg, first)
|
||||
except Exception:
|
||||
scroll.mount(msg)
|
||||
else:
|
||||
scroll.mount(msg)
|
||||
except Exception:
|
||||
|
||||
Reference in New Issue
Block a user