You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-09 12:50:35 +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
@@ -2420,7 +2420,7 @@ bool Window::has_theme_constant(const StringName &p_name, const StringName &p_th
|
||||
|
||||
void Window::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 (theme_icon_override.has(p_name)) {
|
||||
theme_icon_override[p_name]->disconnect_changed(callable_mp(this, &Window::_notify_theme_override_changed));
|
||||
@@ -2433,7 +2433,7 @@ void Window::add_theme_icon_override(const StringName &p_name, const Ref<Texture
|
||||
|
||||
void Window::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 (theme_style_override.has(p_name)) {
|
||||
theme_style_override[p_name]->disconnect_changed(callable_mp(this, &Window::_notify_theme_override_changed));
|
||||
@@ -2446,7 +2446,7 @@ void Window::add_theme_style_override(const StringName &p_name, const Ref<StyleB
|
||||
|
||||
void Window::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 (theme_font_override.has(p_name)) {
|
||||
theme_font_override[p_name]->disconnect_changed(callable_mp(this, &Window::_notify_theme_override_changed));
|
||||
|
||||
Reference in New Issue
Block a user