summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Markmann <tm@ayena.de>2017-03-30 13:30:06 (GMT)
committerTobias Markmann <tm@ayena.de>2017-03-30 13:30:06 (GMT)
commit3611f7cbdcc1a9c96a542d40a439712cf5c3818a (patch)
treea107b32c68fe1dab0117c216c664d86da5f0bfb9 /Swift/QtUI/UserSearch
parent7c047cba09ecc963b66170b0abb2238aa895ccfb (diff)
downloadswift-3611f7cbdcc1a9c96a542d40a439712cf5c3818a.zip
swift-3611f7cbdcc1a9c96a542d40a439712cf5c3818a.tar.bz2
Fix access to potential unavailable page in QtUserSearchWindow
Adding searched JIDs to the list of JIDs only makes sense for cases where there is a multi JID page in the first place. Coverity raised this issue. Test-Information: All unit tests pass on macOS 10.12.4 and the “Add Contact” and “Start Chat” dialogs using a user search still work. Change-Id: Icde63f13a2f83690b3189a9c91237eadd6b5218b
Diffstat (limited to 'Swift/QtUI/UserSearch')
-rw-r--r--Swift/QtUI/UserSearch/QtUserSearchWindow.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/Swift/QtUI/UserSearch/QtUserSearchWindow.cpp b/Swift/QtUI/UserSearch/QtUserSearchWindow.cpp
index cf62540..7575a13 100644
--- a/Swift/QtUI/UserSearch/QtUserSearchWindow.cpp
+++ b/Swift/QtUI/UserSearch/QtUserSearchWindow.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010-2016 Isode Limited.
+ * Copyright (c) 2010-2017 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -81,7 +81,7 @@ void QtUserSearchWindow::handleCurrentChanged(int page) {
firstMultiJIDPage_->reset();
}
resultsPage_->emitCompletenessCheck();
- if (page == 1 && lastPage_ == 3) {
+ if (firstMultiJIDPage_ && page == 1 && lastPage_ == 3) {
addSearchedJIDToList(getContact());
setSecondPage();
}