stop redo throwing an exception if there is nothing to redo

bulletsim
Justin Clark-Casey (justincc) 2011-07-19 06:05:23 +01:00
parent 25c532f2ec
commit ec1ecd3633
1 changed files with 13 additions and 10 deletions

View File

@ -3778,23 +3778,26 @@ namespace OpenSim.Region.Framework.Scenes
// "[SCENE OBJECT PART]: Handling redo request for {0} {1}, stack size {2}", // "[SCENE OBJECT PART]: Handling redo request for {0} {1}, stack size {2}",
// Name, LocalId, m_redo.Count); // Name, LocalId, m_redo.Count);
UndoState gofwd = m_redo.Pop(); if (m_redo.Count > 0)
if (gofwd != null)
{ {
if (m_parentGroup.GetSceneMaxUndo() > 0) UndoState gofwd = m_redo.Pop();
if (gofwd != null)
{ {
UndoState nUndo = new UndoState(this, gofwd.ForGroup); if (m_parentGroup.GetSceneMaxUndo() > 0)
{
m_undo.Push(nUndo); UndoState nUndo = new UndoState(this, gofwd.ForGroup);
m_undo.Push(nUndo);
}
gofwd.PlayfwdState(this);
} }
gofwd.PlayfwdState(this);
}
// m_log.DebugFormat( // m_log.DebugFormat(
// "[SCENE OBJECT PART]: Handled redo request for {0} {1}, stack size now {2}", // "[SCENE OBJECT PART]: Handled redo request for {0} {1}, stack size now {2}",
// Name, LocalId, m_redo.Count); // Name, LocalId, m_redo.Count);
}
} }
} }