summaryrefslogtreecommitdiff
path: root/core/undo_redo.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'core/undo_redo.cpp')
-rw-r--r--core/undo_redo.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/core/undo_redo.cpp b/core/undo_redo.cpp
index 46d38b3abc..a105fba290 100644
--- a/core/undo_redo.cpp
+++ b/core/undo_redo.cpp
@@ -27,6 +27,7 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
+
#include "undo_redo.h"
#include "os/os.h"
@@ -107,6 +108,7 @@ void UndoRedo::create_action(const String &p_name, MergeMode p_mode) {
void UndoRedo::add_do_method(Object *p_object, const String &p_method, VARIANT_ARG_DECLARE) {
VARIANT_ARGPTRS
+ ERR_FAIL_COND(p_object == NULL);
ERR_FAIL_COND(action_level <= 0);
ERR_FAIL_COND((current_action + 1) >= actions.size());
Operation do_op;
@@ -126,6 +128,7 @@ void UndoRedo::add_do_method(Object *p_object, const String &p_method, VARIANT_A
void UndoRedo::add_undo_method(Object *p_object, const String &p_method, VARIANT_ARG_DECLARE) {
VARIANT_ARGPTRS
+ ERR_FAIL_COND(p_object == NULL);
ERR_FAIL_COND(action_level <= 0);
ERR_FAIL_COND((current_action + 1) >= actions.size());
@@ -148,6 +151,7 @@ void UndoRedo::add_undo_method(Object *p_object, const String &p_method, VARIANT
}
void UndoRedo::add_do_property(Object *p_object, const String &p_property, const Variant &p_value) {
+ ERR_FAIL_COND(p_object == NULL);
ERR_FAIL_COND(action_level <= 0);
ERR_FAIL_COND((current_action + 1) >= actions.size());
Operation do_op;
@@ -162,6 +166,7 @@ void UndoRedo::add_do_property(Object *p_object, const String &p_property, const
}
void UndoRedo::add_undo_property(Object *p_object, const String &p_property, const Variant &p_value) {
+ ERR_FAIL_COND(p_object == NULL);
ERR_FAIL_COND(action_level <= 0);
ERR_FAIL_COND((current_action + 1) >= actions.size());
@@ -181,6 +186,7 @@ void UndoRedo::add_undo_property(Object *p_object, const String &p_property, con
}
void UndoRedo::add_do_reference(Object *p_object) {
+ ERR_FAIL_COND(p_object == NULL);
ERR_FAIL_COND(action_level <= 0);
ERR_FAIL_COND((current_action + 1) >= actions.size());
Operation do_op;
@@ -193,6 +199,7 @@ void UndoRedo::add_do_reference(Object *p_object) {
}
void UndoRedo::add_undo_reference(Object *p_object) {
+ ERR_FAIL_COND(p_object == NULL);
ERR_FAIL_COND(action_level <= 0);
ERR_FAIL_COND((current_action + 1) >= actions.size());