From ec1ecd363317fd83fd30f45d9c033873f4c35bc2 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Tue, 19 Jul 2011 06:05:23 +0100 Subject: stop redo throwing an exception if there is nothing to redo --- OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 23 ++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 9d7f87a..ccf8a25 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs @@ -3778,23 +3778,26 @@ namespace OpenSim.Region.Framework.Scenes // "[SCENE OBJECT PART]: Handling redo request for {0} {1}, stack size {2}", // Name, LocalId, m_redo.Count); - UndoState gofwd = m_redo.Pop(); - - if (gofwd != null) + if (m_redo.Count > 0) { - if (m_parentGroup.GetSceneMaxUndo() > 0) + UndoState gofwd = m_redo.Pop(); + + if (gofwd != null) { - UndoState nUndo = new UndoState(this, gofwd.ForGroup); - - m_undo.Push(nUndo); + if (m_parentGroup.GetSceneMaxUndo() > 0) + { + UndoState nUndo = new UndoState(this, gofwd.ForGroup); + + m_undo.Push(nUndo); + } + + gofwd.PlayfwdState(this); } - gofwd.PlayfwdState(this); - } - // m_log.DebugFormat( // "[SCENE OBJECT PART]: Handled redo request for {0} {1}, stack size now {2}", // Name, LocalId, m_redo.Count); + } } } -- cgit v1.1