From f54d4fc3db2d2472a46e6fda68d55624e0bbe344 Mon Sep 17 00:00:00 2001 From: hjk Date: Fri, 9 Dec 2016 12:35:46 +0100 Subject: [PATCH] Core: Don't assert on valid nullptr cases Change-Id: I40919e9ba16c2cc8cf401fc0c9f49267a215af71 Reviewed-by: Eike Ziller Reviewed-by: Tim Jenssen --- src/plugins/coreplugin/find/highlightscrollbar.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/plugins/coreplugin/find/highlightscrollbar.cpp b/src/plugins/coreplugin/find/highlightscrollbar.cpp index c7cc690fa93..5c25984758a 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) {