[Core] Replace ERR_FAIL_COND with ERR_FAIL_NULL where applicable

This commit is contained in:
A Thousand Ships
2023-09-09 16:11:33 +02:00
parent 221884e6bc
commit 893f889d74
44 changed files with 152 additions and 152 deletions

View File

@ -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();

View File

@ -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) {

View File

@ -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();
}