You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-15 13:51:40 +00:00
Improve use of Ref.is_null/valid
Use `is_null` over `!is_valid` and vice versa.
This commit is contained in:
committed by
AThousandShips
parent
0f95e9f8e6
commit
a1846b27ea
@@ -2855,7 +2855,7 @@ bool Control::has_theme_constant(const StringName &p_name, const StringName &p_t
|
||||
|
||||
void Control::add_theme_icon_override(const StringName &p_name, const Ref<Texture2D> &p_icon) {
|
||||
ERR_MAIN_THREAD_GUARD;
|
||||
ERR_FAIL_COND(!p_icon.is_valid());
|
||||
ERR_FAIL_COND(p_icon.is_null());
|
||||
|
||||
if (data.theme_icon_override.has(p_name)) {
|
||||
data.theme_icon_override[p_name]->disconnect_changed(callable_mp(this, &Control::_notify_theme_override_changed));
|
||||
@@ -2868,7 +2868,7 @@ void Control::add_theme_icon_override(const StringName &p_name, const Ref<Textur
|
||||
|
||||
void Control::add_theme_style_override(const StringName &p_name, const Ref<StyleBox> &p_style) {
|
||||
ERR_MAIN_THREAD_GUARD;
|
||||
ERR_FAIL_COND(!p_style.is_valid());
|
||||
ERR_FAIL_COND(p_style.is_null());
|
||||
|
||||
if (data.theme_style_override.has(p_name)) {
|
||||
data.theme_style_override[p_name]->disconnect_changed(callable_mp(this, &Control::_notify_theme_override_changed));
|
||||
@@ -2881,7 +2881,7 @@ void Control::add_theme_style_override(const StringName &p_name, const Ref<Style
|
||||
|
||||
void Control::add_theme_font_override(const StringName &p_name, const Ref<Font> &p_font) {
|
||||
ERR_MAIN_THREAD_GUARD;
|
||||
ERR_FAIL_COND(!p_font.is_valid());
|
||||
ERR_FAIL_COND(p_font.is_null());
|
||||
|
||||
if (data.theme_font_override.has(p_name)) {
|
||||
data.theme_font_override[p_name]->disconnect_changed(callable_mp(this, &Control::_notify_theme_override_changed));
|
||||
|
||||
Reference in New Issue
Block a user