Skip to content

Commit

Permalink
Small safe-guard
Browse files Browse the repository at this point in the history
It was possible to crash here, though not likely.
  • Loading branch information
Jowan-Spooner committed Jan 7, 2025
1 parent da7edd8 commit 835dc94
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion addons/dialogic/Modules/Character/event_character.gd
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down
2 changes: 1 addition & 1 deletion addons/dialogic/Modules/Text/event_text.gd
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down

0 comments on commit 835dc94

Please sign in to comment.