Wed, 02 Oct 2024 09:10:04 +0200
Corrected an issue causing an AttributeError exception.
OllamaInterface/OllamaChatWidget.py | file | annotate | diff | comparison | revisions |
--- 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)