You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-07 12:30:27 +00:00
[Core,Drivers] Improve use of Ref.is_null/valid
Use `is_null` over `!is_valid` and vice versa.
This commit is contained in:
@@ -940,7 +940,7 @@ void Object::set_script(const Variant &p_script) {
|
||||
script_instance = nullptr;
|
||||
}
|
||||
|
||||
if (!s.is_null()) {
|
||||
if (s.is_valid()) {
|
||||
if (s->can_instantiate()) {
|
||||
OBJ_DEBUG_LOCK
|
||||
script_instance = s->instance_create(this);
|
||||
@@ -1579,7 +1579,7 @@ void Object::_clear_internal_resource_paths(const Variant &p_var) {
|
||||
switch (p_var.get_type()) {
|
||||
case Variant::OBJECT: {
|
||||
Ref<Resource> r = p_var;
|
||||
if (!r.is_valid()) {
|
||||
if (r.is_null()) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user