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

Silence error on get_meta(..., null) #1641

Conversation

oddfacade
Copy link
Contributor

As per the Object docs, providing a default value of null to the get_meta call doesn't silence the error in the event that the metadata key doesn't exist. We have a few instances of this pattern throughout the codebase, which were producing unintended error messages under certain circumstances.

This commit replaces them with explicit has_meta checks, where appropriate. In situations where the null value should be an error (typically because it was previously checked) I removed the default argument, to avoid confusion (the behavior is the same).

Also did some boy scout rule cleanup of trailing whitespace and refactored some confusing branch logic in DialogicGameHandler.gd.

As per the `Object` docs, providing a default value of `null` to the
`get_meta` call doesn't silence the error in the event that the metadata
key doesn't exist. We have a few instances of this pattern throughout
the codebase, which were producing unintended error messages under
certain circumstances.

This commit replaces them with explicit `has_meta` checks,
where appropriate. In situations where the null value should be an error
(typically because it was previously checked) I removed the default
argument, to avoid confusion (the behavior is the same).

Also did some boy scout rule cleanup of trailing whitespace and
refactored some confusing branch logic in `DialogicGameHandler.gd`.
@coppolaemilio
Copy link
Collaborator

@Jowan-Spooner want to take a look? looks good to me

@Jowan-Spooner
Copy link
Collaborator

Generally looks good to me as well. I'm still traveling and access to internet is rare so I can't trst it. I'll be properly back on Friday or Saturday. But this looks like it can be merged.

@coppolaemilio coppolaemilio merged commit a6525ab into dialogic-godot:main Jul 26, 2023
@coppolaemilio
Copy link
Collaborator

Thank you @oddfacade !

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.

3 participants