From ab3ec52e78afe164158e471c8883051815856171 Mon Sep 17 00:00:00 2001 From: Uwe Rathmann Date: Tue, 10 Mar 2020 10:24:02 +0100 Subject: [PATCH] some defensive checks added --- src/controls/QskScrollView.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/controls/QskScrollView.cpp b/src/controls/QskScrollView.cpp index a674f86f..357422f9 100644 --- a/src/controls/QskScrollView.cpp +++ b/src/controls/QskScrollView.cpp @@ -294,7 +294,7 @@ void QskScrollView::ensureVisible( const QPointF& pos ) const QPoint newPos( x - margin, y - margin ); - if ( isInitiallyPainted() ) + if( isInitiallyPainted() && window() ) scrollTo( newPos ); else setScrollPos( newPos ); @@ -338,7 +338,7 @@ void QskScrollView::ensureVisible( const QRectF& itemRect ) const QPoint newPos( x - margin, y - margin ); - if ( isInitiallyPainted() ) + if( isInitiallyPainted() && window() ) scrollTo( newPos ); else setScrollPos( newPos );