Commit 73bbb59a authored by Daniel Teske's avatar Daniel Teske

TargetSelector: Don't crash in currentSubIndex()

if the currentIndex() is -1

Task-number: QTCREATORBUG-10872
Change-Id: Ia1c8d3df21649294eeadfbf84a4432c69e74616f
Reviewed-by: default avatarTobias Hunger <tobias.hunger@digia.com>
Reviewed-by: default avatarKai Koehne <kai.koehne@digia.com>
parent 41320112
...@@ -62,7 +62,10 @@ public: ...@@ -62,7 +62,10 @@ public:
Target targetAt(int index) const; Target targetAt(int index) const;
int targetCount() const { return m_targets.size(); } int targetCount() const { return m_targets.size(); }
int currentIndex() const { return m_currentTargetIndex; } int currentIndex() const { return m_currentTargetIndex; }
int currentSubIndex() const { return m_targets.at(m_currentTargetIndex).currentSubIndex; } int currentSubIndex() const {
return m_currentTargetIndex == -1 ? -1
: m_targets.at(m_currentTargetIndex).currentSubIndex;
}
void setTargetMenu(QMenu *menu); void setTargetMenu(QMenu *menu);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment