OllamaInterface/OllamaChatWidget.py

changeset 57
3a3726c1f684
parent 44
ef9a85b8768a
child 67
3c2bcbf7eeaf
diff -r ef2d5f24ad32 -r 3a3726c1f684 OllamaInterface/OllamaChatWidget.py
--- a/OllamaInterface/OllamaChatWidget.py	Sun Sep 29 11:40:07 2024 +0200
+++ b/OllamaInterface/OllamaChatWidget.py	Wed Oct 02 09:10:04 2024 +0200
@@ -85,10 +85,11 @@
         @param message message text to be appended
         @type str
         """
-        msgBox = self.__messagesLayout.itemAt(
-            self.__messagesLayout.count() - 1
-        ).widget()
-        msgBox.appendMessage(message)
+        if self.__messagesLayout.count():
+            msgBox = self.__messagesLayout.itemAt(
+                self.__messagesLayout.count() - 1
+            ).widget()
+            msgBox.appendMessage(message)
 
         QTimer.singleShot(0, self.__scrollChatToBottom)
 

eric ide

mercurial