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

Conversation

oddfacade
Copy link
Contributor

There are a few places where we do a update_name_label(null), which makes character.resource_path throw an invalid index error. This commit fixes this bug; also a fixes a related bug in the same function where it is possible to access
dialogic.current_state_info['character'] before it is defined.

There are a few places where we do a `update_name_label(null)`, which
makes `character.resource_path` throw an invalid index error. This
commit fixes this bug; also a fixes a related bug in the same function
where it is possible to access
`dialogic.current_state_info['character']` before it is defined.
@@ -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?

@coppolaemilio
Copy link
Collaborator

Merging for now since it fixes the issue :)

@coppolaemilio coppolaemilio merged commit ececccc into dialogic-godot:main Apr 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants