diff options
author | Kevin Smith <git@kismith.co.uk> | 2014-11-14 19:42:00 (GMT) |
---|---|---|
committer | Kevin Smith <git@kismith.co.uk> | 2015-03-24 17:25:41 (GMT) |
commit | b23f4fb9bee49f93bbba6a9039f0f764664125cd (patch) | |
tree | 966bd28d91cff6a09794d93842132fb08f209e1e /Swift | |
parent | cd193389d65c4abd51c557f942348f36356f4788 (diff) | |
download | swift-b23f4fb9bee49f93bbba6a9039f0f764664125cd.zip swift-b23f4fb9bee49f93bbba6a9039f0f764664125cd.tar.bz2 |
Don't crash when the UI doesn't provide a user search window
Change-Id: I9c8692e0c4f36877591385a7580cb8a2107bd68f
Diffstat (limited to 'Swift')
-rw-r--r-- | Swift/Controllers/Chat/UserSearchController.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/Swift/Controllers/Chat/UserSearchController.cpp b/Swift/Controllers/Chat/UserSearchController.cpp index 53898a1..24f3724 100644 --- a/Swift/Controllers/Chat/UserSearchController.cpp +++ b/Swift/Controllers/Chat/UserSearchController.cpp @@ -65,7 +65,9 @@ void UserSearchController::setCanInitiateImpromptuMUC(bool supportsImpromptu) { if (!window_) { initializeUserWindow(); } - window_->setCanStartImpromptuChats(supportsImpromptu); + if (window_) { + window_->setCanStartImpromptuChats(supportsImpromptu); + } // Else doesn't support search } void UserSearchController::handleUIEvent(boost::shared_ptr<UIEvent> event) { @@ -323,6 +325,10 @@ void UserSearchController::initializeUserWindow() { } window_ = factory_->createUserSearchWindow(windowType, uiEventStream_, rosterController_->getGroups()); + if (!window_) { + // UI Doesn't support user search + return; + } window_->onNameSuggestionRequested.connect(boost::bind(&UserSearchController::handleNameSuggestionRequest, this, _1)); window_->onFormRequested.connect(boost::bind(&UserSearchController::handleFormRequested, this, _1)); window_->onSearchRequested.connect(boost::bind(&UserSearchController::handleSearch, this, _1, _2)); |