diff options
author | A Thousand Ships <96648715+AThousandShips@users.noreply.github.com> | 2023-09-09 16:11:33 +0200 |
---|---|---|
committer | A Thousand Ships <96648715+AThousandShips@users.noreply.github.com> | 2023-09-11 19:45:49 +0200 |
commit | 893f889d74b35bb7330c3ff3d0187042770a4490 (patch) | |
tree | b1435faf6380670ffc4a878d0cdcb29a0527f5a7 /core/string | |
parent | 221884e6bc260c38f16422081b7d4efd49a71375 (diff) | |
download | redot-engine-893f889d74b35bb7330c3ff3d0187042770a4490.tar.gz |
[Core] Replace `ERR_FAIL_COND` with `ERR_FAIL_NULL` where applicable
Diffstat (limited to 'core/string')
-rw-r--r-- | core/string/node_path.cpp | 8 | ||||
-rw-r--r-- | core/string/print_string.cpp | 2 | ||||
-rw-r--r-- | core/string/string_name.cpp | 4 |
3 files changed, 7 insertions, 7 deletions
diff --git a/core/string/node_path.cpp b/core/string/node_path.cpp index af7c18741d..32e4564c5e 100644 --- a/core/string/node_path.cpp +++ b/core/string/node_path.cpp @@ -73,7 +73,7 @@ int NodePath::get_name_count() const { } StringName NodePath::get_name(int p_idx) const { - ERR_FAIL_COND_V(!data, StringName()); + ERR_FAIL_NULL_V(data, StringName()); ERR_FAIL_INDEX_V(p_idx, data->path.size(), StringName()); return data->path[p_idx]; } @@ -87,7 +87,7 @@ int NodePath::get_subname_count() const { } StringName NodePath::get_subname(int p_idx) const { - ERR_FAIL_COND_V(!data, StringName()); + ERR_FAIL_NULL_V(data, StringName()); ERR_FAIL_INDEX_V(p_idx, data->subpath.size(), StringName()); return data->subpath[p_idx]; } @@ -200,7 +200,7 @@ Vector<StringName> NodePath::get_subnames() const { } StringName NodePath::get_concatenated_names() const { - ERR_FAIL_COND_V(!data, StringName()); + ERR_FAIL_NULL_V(data, StringName()); if (!data->concatenated_path) { int pc = data->path.size(); @@ -215,7 +215,7 @@ StringName NodePath::get_concatenated_names() const { } StringName NodePath::get_concatenated_subnames() const { - ERR_FAIL_COND_V(!data, StringName()); + ERR_FAIL_NULL_V(data, StringName()); if (!data->concatenated_subpath) { int spc = data->subpath.size(); diff --git a/core/string/print_string.cpp b/core/string/print_string.cpp index dcdde3c175..e3614be359 100644 --- a/core/string/print_string.cpp +++ b/core/string/print_string.cpp @@ -65,7 +65,7 @@ void remove_print_handler(const PrintHandlerList *p_handler) { //OS::get_singleton()->print("print handler list is %p\n",print_handler_list); _global_unlock(); - ERR_FAIL_COND(l == nullptr); + ERR_FAIL_NULL(l); } void __print_line(String p_string) { diff --git a/core/string/string_name.cpp b/core/string/string_name.cpp index 6099fea13f..4402e44ad4 100644 --- a/core/string/string_name.cpp +++ b/core/string/string_name.cpp @@ -390,7 +390,7 @@ StringName::StringName(const String &p_name, bool p_static) { StringName StringName::search(const char *p_name) { ERR_FAIL_COND_V(!configured, StringName()); - ERR_FAIL_COND_V(!p_name, StringName()); + ERR_FAIL_NULL_V(p_name, StringName()); if (!p_name[0]) { return StringName(); } @@ -426,7 +426,7 @@ StringName StringName::search(const char *p_name) { StringName StringName::search(const char32_t *p_name) { ERR_FAIL_COND_V(!configured, StringName()); - ERR_FAIL_COND_V(!p_name, StringName()); + ERR_FAIL_NULL_V(p_name, StringName()); if (!p_name[0]) { return StringName(); } |