From 1af5b9fce42649912f76ac56fe1374f63e4f67e9 Mon Sep 17 00:00:00 2001 From: Thomas Lauzi Date: Sun, 29 Mar 2020 23:21:22 +0200 Subject: [PATCH] FIX: NullReferenceException --- Core/Commands/DeleteOperatorsCommand.cs | 5 +++++ Core/UndoRedoStack.cs | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Core/Commands/DeleteOperatorsCommand.cs b/Core/Commands/DeleteOperatorsCommand.cs index 0900bf1..c5e2522 100644 --- a/Core/Commands/DeleteOperatorsCommand.cs +++ b/Core/Commands/DeleteOperatorsCommand.cs @@ -107,6 +107,11 @@ public void Undo() public void Do() { + if (_removeKeyframesCommand == null) + { + return; + } + _removeKeyframesCommand.Do(); var parent = MetaManager.Instance.GetMetaOperator(_parentMetaID); diff --git a/Core/UndoRedoStack.cs b/Core/UndoRedoStack.cs index 6785a26..f67ae09 100644 --- a/Core/UndoRedoStack.cs +++ b/Core/UndoRedoStack.cs @@ -297,7 +297,7 @@ public bool ProcessReceivedCommands() public void Add(ICommand command) { - if (command.IsUndoable) + if (command != null && command.IsUndoable) { var jsonCommand = SerializeCommand(command); #if USE_COUCHDB