From f0217cac6dde49cd63cd92dd842ac60350d75bc3 Mon Sep 17 00:00:00 2001 From: sln Date: Thu, 11 Feb 2010 11:55:43 +0000 Subject: [PATCH] updateBorders method fixed(). Protection from null GLViewer_Rect is provided --- src/GLViewer/GLViewer_Viewer2d.cxx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/GLViewer/GLViewer_Viewer2d.cxx b/src/GLViewer/GLViewer_Viewer2d.cxx index d9b2bbec3..2fb24d28b 100644 --- a/src/GLViewer/GLViewer_Viewer2d.cxx +++ b/src/GLViewer/GLViewer_Viewer2d.cxx @@ -144,6 +144,9 @@ void GLViewer_Viewer2d::updateColors( QColor colorH, QColor colorS ) */ void GLViewer_Viewer2d::updateBorders( GLViewer_Rect* theRect ) { + if ( theRect->isNull() ) + return; + QVector views = getViewManager()->getViews(); for ( int i = 0, n = views.count(); i < n; i++ ) { @@ -178,7 +181,7 @@ void GLViewer_Viewer2d::updateBorders() { GLViewer_Object* anObject = *it; GLViewer_Rect* aRect = anObject->getRect(); - if( !anObject->isScalable() || !anObject->getVisible() ) + if( !anObject->isScalable() || !anObject->getVisible() || aRect->isNull() ) continue; if( border->isEmpty() ) -- 2.39.2