[network/ruqola] src/widgets/room: Don't warn about invalid line in database when roomId is empty.

Laurent Montel <[email protected]>
Newsgroups gmane.comp.kde.cvs
Message-ID <[email protected]>
Git commit ff60c17e5ab86586ae2e9579daa52d7390cfe9ec by Laurent Montel.
Committed on 30/07/2026 at 06:32.
Pushed by mlaurent into branch 'master'.

Don't warn about invalid line in database when roomId is empty.

It can be empty when we switch account => roomId is cleared.

M  +7    -0    src/widgets/room/roomwidget.cpp

https://invent.kde.org/network/ruqola/-/commit/ff60c17e5ab86586ae2e9579daa52d7390cfe9ec

diff --git a/src/widgets/room/roomwidget.cpp b/src/widgets/room/roomwidget.cpp
index 5aafadb044..2e830a2de3 100644
--- a/src/widgets/room/roomwidget.cpp
+++ b/src/widgets/room/roomwidget.cpp
@@ -718,6 +718,13 @@ void RoomWidget::dropEvent(QDropEvent *event)
 void RoomWidget::storeRoomSettings()
 {
     if (mCurrentRocketChatAccount) {
+        // When we switch account, we clear roomId and if we call select channel
+        // it will call storeRoomSettings() method with roomId is empty
+        // It will write debug about invalid line in database.
+        // => Make sure that it's not empty.
+        if (mRoomWidgetBase->roomId().isEmpty()) {
+            return;
+        }
         if (mRoomWidgetBase->messageLineWidget()->text().isEmpty() && !mRoomWidgetBase->messageLineWidget()->hasAttachments()) {
             auto *vbar = mRoomWidgetBase->messageListView()->verticalScrollBar();
             if (vbar->value() != vbar->maximum()) {
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.