diff --git a/scene/gui/rich_text_label.cpp b/scene/gui/rich_text_label.cpp index 94e0944628d..8f2eb7b3fb8 100644 --- a/scene/gui/rich_text_label.cpp +++ b/scene/gui/rich_text_label.cpp @@ -4883,11 +4883,10 @@ void RichTextLabel::install_effect(const Variant effect) { Ref rteffect; rteffect = effect; - if (rteffect.is_valid()) { - custom_effects.push_back(effect); - if ((!text.is_empty()) && use_bbcode) { - parse_bbcode(text); - } + ERR_FAIL_COND_MSG(rteffect.is_null(), "Invalid RichTextEffect resource."); + custom_effects.push_back(effect); + if ((!text.is_empty()) && use_bbcode) { + parse_bbcode(text); } }