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

Check parameter validity in Object::set_script #46125

Conversation

angad-k
Copy link
Contributor

@angad-k angad-k commented Feb 17, 2021

fixes #46120

@angad-k angad-k requested a review from a team as a code owner February 17, 2021 15:50
@Calinou Calinou added bug cherrypick:3.x Considered for cherry-picking into a future 3.x release crash topic:core labels Feb 17, 2021
@Calinou Calinou added this to the 4.0 milestone Feb 17, 2021
core/object/object.cpp Outdated Show resolved Hide resolved
@angad-k angad-k force-pushed the fix-object-to-check-script-pointer-validity branch from e992c6f to ea0af3d Compare February 17, 2021 19:06
@theraot
Copy link
Contributor

theraot commented Oct 9, 2021

I tested and reviewed this without a keyboard so I didn't leave a message.

I vow that the bug still happens, and this change fixes it. I did test both setting something that is not a script, which result in an error, and setting null, which does not.

@akien-mga akien-mga modified the milestones: 4.0, 4.1 Feb 12, 2023
@akien-mga akien-mga requested a review from KoBeWi June 16, 2023 15:14
@akien-mga akien-mga modified the milestones: 4.1, 4.x Jun 16, 2023
@akien-mga akien-mga modified the milestones: 4.x, 4.2 Jun 16, 2023
core/object/object.cpp Outdated Show resolved Hide resolved
@akien-mga akien-mga changed the title add null check in set_script method of Object.cpp Check parameter validity in Object::set_script Jun 19, 2023
@YuriSizov YuriSizov added cherrypick:4.0 cherrypick:4.1 Considered for cherry-picking into a future 4.1.x release labels Jul 7, 2023
@akien-mga akien-mga force-pushed the fix-object-to-check-script-pointer-validity branch from ea0af3d to 9c6c2f0 Compare July 7, 2023 14:16
@akien-mga
Copy link
Member

Rebased and improved the error message as suggested above.

@akien-mga akien-mga merged commit 7e39c91 into godotengine:master Jul 8, 2023
13 checks passed
@akien-mga
Copy link
Member

Thanks!

@YuriSizov YuriSizov removed the cherrypick:4.1 Considered for cherry-picking into a future 4.1.x release label Jul 10, 2023
@YuriSizov
Copy link
Contributor

Cherry-picked for 4.1.1.

@akien-mga
Copy link
Member

Cherry-picked for 3.6.

@akien-mga akien-mga removed the cherrypick:3.x Considered for cherry-picking into a future 3.x release label Oct 30, 2023
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.

Crash, when using set_script and emit_signal on AnimatedSprite
6 participants