]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
To prevent crash in selectedObject() method
authorouv <ouv@opencascade.com>
Tue, 23 Nov 2010 13:45:00 +0000 (13:45 +0000)
committerouv <ouv@opencascade.com>
Tue, 23 Nov 2010 13:45:00 +0000 (13:45 +0000)
src/GraphicsView/GraphicsView_ViewPort.cxx

index 44dde465633ee83dca0204d08ef717e123ac4a78..ee9a9ee8b55b958fbf7ab01f6fe9be13644f4659 100644 (file)
@@ -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;
 }
 
 //================================================================