Skip to content

Commit

Permalink
When the thread is empty and you try to open a window this throws an …
Browse files Browse the repository at this point in the history
…error (#155)
  • Loading branch information
jaresty authored Aug 12, 2024
1 parent 0a14c7a commit b1356ef
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/modelConfirmationGUI.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ def update(cls):
cls.display_thread = (
"USER" in GPTState.text_to_confirm and "GPT" in GPTState.text_to_confirm
)
if len(GPTState.thread) == 0:
cls.last_item_text = ""
return

last_message_item = GPTState.thread[-1]["content"][0]
cls.last_item_text = last_message_item.get("text", "")

Expand Down

0 comments on commit b1356ef

Please sign in to comment.