From 96c91e2a35cc4d8ad969b35339cc6dcb375513f5 Mon Sep 17 00:00:00 2001 From: Carl Schwan Date: Sat, 29 May 2021 23:13:16 +0200 Subject: [PATCH] Make sure we only add non empty name or display name in autocompletion list Otherwise this will breaks when replacing names later (cherry picked from commit c7fd5cc511252f3d24b5091c57371e118d20255a) --- imports/NeoChat/Component/ChatBox/ChatBar.qml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/imports/NeoChat/Component/ChatBox/ChatBar.qml b/imports/NeoChat/Component/ChatBox/ChatBar.qml index d31ae7bac..77279cb3c 100644 --- a/imports/NeoChat/Component/ChatBox/ChatBar.qml +++ b/imports/NeoChat/Component/ChatBox/ChatBar.qml @@ -380,7 +380,9 @@ ToolBar { function complete() { documentHandler.replaceAutoComplete(completionMenu.currentDisplayText); - if (completionMenu.completionType === ChatDocumentHandler.User) { + if (completionMenu.completionType === ChatDocumentHandler.User + && completionMenu.currentDisplayText.length > 0 + && completionMenu.currentItem.userId.length > 0) { userAutocompleted[completionMenu.currentDisplayText] = completionMenu.currentItem.userId; } }