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>
This commit is contained in:
hjk
2016-12-09 12:35:46 +01:00
parent 81ebdf3b02
commit f54d4fc3db

View File

@@ -254,10 +254,11 @@ void HighlightScrollBarOverlay::paintEvent(QPaintEvent *paintEvent)
int top = rect.top() + offset + verticalMargin + float(it.key()) / range * rect.height(); int top = rect.top() + offset + verticalMargin + float(it.key()) / range * rect.height();
const int bottom = top + resultHeight; 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 // If the previous highlight has the same category and is directly prior to this highlight
// we just extend the previous highlight. // we just extend the previous highlight.
previousRect->setBottom(bottom - 1); if (QTC_GUARD(previousRect))
previousRect->setBottom(bottom - 1);
} else { // create a new highlight } else { // create a new highlight
if (previousRect && previousBottom >= top) { if (previousRect && previousBottom >= top) {