Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add null check to text update_name_label #1506

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions addons/dialogic/Events/Text/subsystem_text.gd
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,12 @@ func _on_dialog_text_finished():


func update_name_label(character:DialogicCharacter) -> void:
if character.resource_path == dialogic.current_state_info['character']:
var character_path = character.resource_path if character else null
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you split this into several lines?

if character_path == dialogic.current_state_info.get('character'):
return
for name_label in get_tree().get_nodes_in_group('dialogic_name_label'):
if character:
dialogic.current_state_info['character'] = character.resource_path
dialogic.current_state_info['character'] = character_path
if dialogic.has_subsystem('VAR'):
name_label.text = dialogic.VAR.parse_variables(character.display_name)
else:
Expand Down