From 835dc947e01a41c51fd5191823b91013186554d3 Mon Sep 17 00:00:00 2001 From: Jowan-Spooner Date: Tue, 7 Jan 2025 13:51:55 +0100 Subject: [PATCH] Small safe-guard It was possible to crash here, though not likely. --- addons/dialogic/Modules/Character/event_character.gd | 2 +- addons/dialogic/Modules/Text/event_text.gd | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/dialogic/Modules/Character/event_character.gd b/addons/dialogic/Modules/Character/event_character.gd index f48ab593c..df7a16521 100644 --- a/addons/dialogic/Modules/Character/event_character.gd +++ b/addons/dialogic/Modules/Character/event_character.gd @@ -89,7 +89,7 @@ var character_identifier: String: set(value): character_identifier = value character = DialogicResourceUtil.get_character_resource(value) - if character and not character.portraits.has(portrait): + if (not character) or (character and not character.portraits.has(portrait)): portrait = "" ui_update_needed.emit() diff --git a/addons/dialogic/Modules/Text/event_text.gd b/addons/dialogic/Modules/Text/event_text.gd index 5eda05795..b547a252f 100644 --- a/addons/dialogic/Modules/Text/event_text.gd +++ b/addons/dialogic/Modules/Text/event_text.gd @@ -32,7 +32,7 @@ var character_identifier: String: set(value): character_identifier = value character = DialogicResourceUtil.get_character_resource(value) - if not character.portraits.has(portrait): + if (not character) or (character and not character.portraits.has(portrait)): portrait = "" ui_update_needed.emit()