summaryrefslogtreecommitdiff
diff options
authorMarco Trevisan (TreviƱo) <mail@3v1n0.net>2016-05-17 02:56:03 +0000
committerCI Train Bot <ci-train-bot@canonical.com>2016-05-17 02:56:03 +0000
commit45106b189dc41d2cf4a4f5e97ed9724e22d60403 (patch)
tree0d6ba34a8608efcd408f96f7d8d36818fe9b20a5
parentf920ab7c3fdcaa394cd273533598c78190849ebe (diff)
parenta69b1ba109f24eb3a55db54c76bcb831d8686aee (diff)
SwitcherController: don't try to get a window from empty selections Fixes: #1580211
Approved by: PS Jenkins bot, Andrea Azzarone (bzr r4116)
-rw-r--r--launcher/SwitcherController.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/launcher/SwitcherController.cpp b/launcher/SwitcherController.cpp
index 08a00bbbe..391ede77a 100644
--- a/launcher/SwitcherController.cpp
+++ b/launcher/SwitcherController.cpp
@@ -686,7 +686,10 @@ Selection Controller::Impl::GetCurrentSelection() const
}
else if (model_->SelectionIsActive())
{
- window = model_->SelectionWindows().front();
+ auto const& selection_windows = model_->SelectionWindows();
+
+ if (!selection_windows.empty())
+ window = selection_windows.front();
}
}
}