Skip to content

Commit 8b28786

Browse files
committed
Merge pull request godotengine#122175 from kitbdev/fix-shader-editor-stylebox-crash
Fix Shader Editor crash when theme doesn't use `StyleBoxFlat`
2 parents ae96114 + f4ed43c commit 8b28786

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

editor/shader/shader_text_editor.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -765,7 +765,9 @@ void ShaderTextEditor::_notification(int p_what) {
765765
Ref<StyleBoxFlat> tab_style = get_theme_stylebox(SNAME("tab_selected"), "TabBar");
766766
Ref<StyleBoxFlat> preview_style = memnew(StyleBoxFlat);
767767
preview_style->set_bg_color(get_theme_color(SNAME("dark_color_1"), EditorStringName(Editor)));
768-
preview_style->set_corner_radius_all(tab_style->get_corner_radius(CORNER_TOP_LEFT));
768+
if (tab_style.is_valid()) {
769+
preview_style->set_corner_radius_all(tab_style->get_corner_radius(CORNER_TOP_LEFT));
770+
}
769771
preview_panel->add_theme_style_override(SceneStringName(panel), preview_style);
770772

771773
update_params_btn->set_button_icon(get_editor_theme_icon(SNAME("Reload")));

0 commit comments

Comments
 (0)