summaryrefslogtreecommitdiff
path: root/src/plugins
diff options
context:
space:
mode:
authorhjk <hjk@qt.io>2016-12-09 12:35:46 +0100
committerhjk <hjk@qt.io>2016-12-12 12:23:20 +0000
commitf54d4fc3db2d2472a46e6fda68d55624e0bbe344 (patch)
treea8a5c8e2c61b76a44f0a1602e93254734c3ba29c /src/plugins
parent81ebdf3b021632ccc24d49e699dc2229407045b5 (diff)
downloadqt-creator-f54d4fc3db2d2472a46e6fda68d55624e0bbe344.tar.gz
Core: Don't assert on valid nullptr cases
Change-Id: I40919e9ba16c2cc8cf401fc0c9f49267a215af71 Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/coreplugin/find/highlightscrollbar.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/plugins/coreplugin/find/highlightscrollbar.cpp b/src/plugins/coreplugin/find/highlightscrollbar.cpp
index c7cc690fa9..5c25984758 100644
--- a/src/plugins/coreplugin/find/highlightscrollbar.cpp
+++ b/src/plugins/coreplugin/find/highlightscrollbar.cpp
@@ -254,10 +254,11 @@ void HighlightScrollBarOverlay::paintEvent(QPaintEvent *paintEvent)
int top = rect.top() + offset + verticalMargin + float(it.key()) / range * rect.height();
const int bottom = top + resultHeight;
- if (QTC_GUARD(previousRect) && previousCategory == currentCategory && previousBottom + 1 >= top) {
+ if (previousCategory == currentCategory && previousBottom + 1 >= top) {
// If the previous highlight has the same category and is directly prior to this highlight
// we just extend the previous highlight.
- previousRect->setBottom(bottom - 1);
+ if (QTC_GUARD(previousRect))
+ previousRect->setBottom(bottom - 1);
} else { // create a new highlight
if (previousRect && previousBottom >= top) {