Add error for invalid RichTextLabel.install_effect

This commit is contained in:
RedMser 2022-07-24 22:52:50 +02:00
parent 667cef39b4
commit d3a1e82025

View File

@ -4883,11 +4883,10 @@ void RichTextLabel::install_effect(const Variant effect) {
Ref<RichTextEffect> 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);
}
}