From d3a1e82025269ced071a4f72bfb614dda6769a59 Mon Sep 17 00:00:00 2001 From: RedMser Date: Sun, 24 Jul 2022 22:52:50 +0200 Subject: [PATCH] Add error for invalid RichTextLabel.install_effect --- scene/gui/rich_text_label.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) 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); } }