aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/user.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/user.cpp b/lib/user.cpp
index c373a067..951ad87d 100644
--- a/lib/user.cpp
+++ b/lib/user.cpp
@@ -82,7 +82,8 @@ class User::Private
QString User::Private::nameForRoom(const Room* r, const QString& hint) const
{
// If the hint is accurate, this function is O(1) instead of O(n)
- if (hint == mostUsedName || otherNames.contains(hint, r))
+ if (!hint.isNull()
+ && (hint == mostUsedName || otherNames.contains(hint, r)))
return hint;
return otherNames.key(r, mostUsedName);
}