From: ouv Date: Tue, 23 Nov 2010 13:45:00 +0000 (+0000) Subject: To prevent crash in selectedObject() method X-Git-Tag: DIAGRAM_0_1~14 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=2906d4b95fd8fa09205536375b9bdf4dd319bf07;p=modules%2Fgui.git To prevent crash in selectedObject() method --- diff --git a/src/GraphicsView/GraphicsView_ViewPort.cxx b/src/GraphicsView/GraphicsView_ViewPort.cxx index 44dde4656..ee9a9ee8b 100644 --- a/src/GraphicsView/GraphicsView_ViewPort.cxx +++ b/src/GraphicsView/GraphicsView_ViewPort.cxx @@ -849,7 +849,9 @@ bool GraphicsView_ViewPort::nextSelected() //================================================================ GraphicsView_Object* GraphicsView_ViewPort::selectedObject() { - return mySelectedObjects[ mySelectionIterator ]; + if( mySelectionIterator >= 0 && mySelectionIterator < nbSelected() ) + return mySelectedObjects[ mySelectionIterator ]; + return 0; } //================================================================