Fix crash in UserModel::currentUser() and add more sanity checks
authorMichael Schuster <michael@schuster.ms>
Thu, 25 Jun 2020 18:02:22 +0000 (20:02 +0200)
committerCamila <smayres@gmail.com>
Thu, 25 Jun 2020 18:52:30 +0000 (20:52 +0200)
commitd71249bb6e82c92c7d0afb53b226e42ccd85a893
tree5444fc8e1541511a7cec8ae5e597dc5f09f0115c
parent109f9ae60a0f7ad0a7de652ea96e11446b2957fc
Fix crash in UserModel::currentUser() and add more sanity checks

Commit 07bede8 (PR #1892) introduced a new helper method currentUser()
that didn't check for _users.count() thus causing to throw an
"index out of range" exception when no accounts are configured.

This commit uses the opportunity to add more sanity checks to UserModel.

Signed-off-by: Michael Schuster <michael@schuster.ms>
src/gui/tray/UserModel.cpp