From 2906d4b95fd8fa09205536375b9bdf4dd319bf07 Mon Sep 17 00:00:00 2001 From: ouv Date: Tue, 23 Nov 2010 13:45:00 +0000 Subject: [PATCH] To prevent crash in selectedObject() method --- src/GraphicsView/GraphicsView_ViewPort.cxx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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; } //================================================================ -- 2.39.2