summaryrefslogtreecommitdiff
path: root/core/undo_redo.cpp
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2018-01-07 13:03:47 +0100
committerGitHub <noreply@github.com>2018-01-07 13:03:47 +0100
commitfe841fe8273a25bd3fe0a558ec640bc26d0b8784 (patch)
treed915b278539954281a790e8e4998fe22890acfba /core/undo_redo.cpp
parent0593daa826400c1e177c87e1b111fa2b5caa2853 (diff)
parenta6e0dcdcbfe90905bf34007a3d1387a48e1ed5b9 (diff)
Merge pull request #15437 from GodotExplorer/pr-fix-15424
Add null checking for paramaters in UndoRedo
Diffstat (limited to 'core/undo_redo.cpp')
-rw-r--r--core/undo_redo.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/core/undo_redo.cpp b/core/undo_redo.cpp
index a8eb527b09..a105fba290 100644
--- a/core/undo_redo.cpp
+++ b/core/undo_redo.cpp
@@ -108,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;
@@ -127,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());
@@ -149,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;
@@ -163,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());
@@ -182,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;
@@ -194,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());