Add null verification to avoid background theme error in texture shader properties

This commit is contained in:
M4rchyS 2025-12-11 19:11:40 +01:00 committed by Rémi Verschelde
parent dc57cd698d
commit 372e549831
No known key found for this signature in database
GPG key ID: C3336907360768E1

View file

@ -468,7 +468,7 @@ void EditorProperty::_notification(int p_what) {
// Only draw the label if it's not empty.
if (label.is_empty()) {
size.height = 0;
} else if (sub_inspector_color_level >= 0) {
} else if (sub_inspector_color_level >= 0 && theme_cache.sub_inspector_background[sub_inspector_color_level].is_valid()) {
draw_style_box(theme_cache.sub_inspector_background[sub_inspector_color_level], Rect2(Vector2(), size));
} else {
draw_style_box(selected ? theme_cache.background_selected : theme_cache.background, Rect2(Vector2(), size));