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

[3.x] Add type validations when setting basic type #53464

Merged
merged 1 commit into from
Jan 8, 2022
Merged

[3.x] Add type validations when setting basic type #53464

merged 1 commit into from
Jan 8, 2022

Conversation

LATRio
Copy link
Contributor

@LATRio LATRio commented Oct 6, 2021

fixes #53456

@LATRio LATRio requested review from a team as code owners October 6, 2021 09:23
@LATRio LATRio changed the title Add type validations when setting basic type [3.x] Add type validations when setting basic type Oct 6, 2021
@YeldhamDev YeldhamDev added this to the 3.4 milestone Oct 6, 2021
@akien-mga akien-mga modified the milestones: 3.4, 3.5 Nov 8, 2021
Copy link
Member

@akien-mga akien-mga left a comment

Choose a reason for hiding this comment

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

The VisualScript fixes are good, but I'm not sure about the changes to Variant. It changes behavior as now it those functions will throw an error if the method doesn't exist, while previously they would handle it silently. Needs @godotengine/core review.

@akien-mga
Copy link
Member

Also, #53456 should be checked against the master branch as it might be reproducible there too.

if (!E) {
return Vector<Variant::Type>();
}
ERR_FAIL_COND_V(!E, Vector<Variant::Type>());
Copy link
Member

Choose a reason for hiding this comment

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

We discussed this in a review meeting, the ERR_FAIL_INDEX_V are good, but we're not confident that the change from if (!E) to an error condition is good. There's a risk that these methods might actually be used with non-existing methods at times and the code expects it to return an empty/default value.

Since it's not part of the fix for the reported bug, it's probably best to leave this part alone (same in other methods, only validate p_type).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed changes.

@akien-mga akien-mga force-pushed the 3.x branch 2 times, most recently from 71cb8d3 to c58391c Compare January 6, 2022 22:40
@akien-mga akien-mga merged commit 37b9aba into godotengine:3.x Jan 8, 2022
@akien-mga
Copy link
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants