diff --git a/Src/Common/SimpleRootSite/EditingHelper.cs b/Src/Common/SimpleRootSite/EditingHelper.cs index 7a22205912..56f14d304f 100644 --- a/Src/Common/SimpleRootSite/EditingHelper.cs +++ b/Src/Common/SimpleRootSite/EditingHelper.cs @@ -3257,9 +3257,17 @@ internal void CopyTssToClipboard(ITsString tss) /// protected virtual void DeleteSelectionTask(string undoLabel, string redoLabel) { - Callbacks.EditedRootBox.DataAccess.GetActionHandler().BeginUndoTask(undoLabel, redoLabel); - DeleteSelection(); - Callbacks.EditedRootBox.DataAccess.GetActionHandler().EndUndoTask(); + IActionHandler actionHandler = Callbacks.EditedRootBox.DataAccess.GetActionHandler(); + if (actionHandler != null) + { + actionHandler.BeginUndoTask(undoLabel, redoLabel); + DeleteSelection(); + actionHandler.EndUndoTask(); + } + else + { + DeleteSelection(); + } } /// -----------------------------------------------------------------------------------