Skip to content

Commit c5f3a30

Browse files
Handle empty accounts case explicitly
Address reviewer feedback: explicitly handle the case when no accounts are logged in. When _users.isEmpty(), we ensure _init is set to false and _currentUserId remains -1 (no account selected). Signed-off-by: harshasiddartha <[email protected]>
1 parent f45097a commit c5f3a30

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/gui/tray/usermodel.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1373,6 +1373,10 @@ void UserModel::buildUserList()
13731373
// Fallback to first account if last selected account not found
13741374
setCurrentUserId(0);
13751375
_init = false;
1376+
} else if (_init && _users.isEmpty()) {
1377+
// No accounts available - ensure initialization is complete
1378+
// _currentUserId remains -1 (no account selected)
1379+
_init = false;
13761380
}
13771381
}
13781382

0 commit comments

Comments
 (0)