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

Fix a crash when built-in script is not saved and have syntax error #81156

Conversation

jsjtxietian
Copy link
Contributor

Fixes #81149.

When built-in script is not saved, it has empty path, and origin code assumes error with empty path is a depended_error but that's not always the case. When error's path and script's path are both empty, maybe we can believe it is an error caused by a script that's not been saved instead of a depended error.

Also add some protection before access error list's index 0.

When built-in script is not saved, it has empty path, and origin
code assumes error with empty path is a depended_error but that's
not always the case.
Also add protection before access list index 0.
@jsjtxietian jsjtxietian requested a review from a team as a code owner August 30, 2023 09:53
@akien-mga akien-mga added this to the 4.2 milestone Aug 30, 2023
@akien-mga akien-mga added crash cherrypick:4.1 Considered for cherry-picking into a future 4.1.x release labels Aug 30, 2023
@akien-mga akien-mga requested a review from KoBeWi August 30, 2023 09:59
@akien-mga akien-mga merged commit 56a5fb2 into godotengine:master Aug 31, 2023
15 checks passed
@akien-mga
Copy link
Member

Thanks!

@jsjtxietian jsjtxietian deleted the fix-crash-when-built-in-scripts-not-saved-and-have-error branch August 31, 2023 09:24
@YuriSizov YuriSizov removed the cherrypick:4.1 Considered for cherry-picking into a future 4.1.x release label Sep 20, 2023
@YuriSizov
Copy link
Contributor

This fix depends on #75216, which is not cherry-pickable and may in fact be the source of the bug. Report only refers to a 4.2 dev snapshot, and not previous 4.x releases. If the issue is also present in 4.1, a dedicated PR would be appreciated.

@KoBeWi
Copy link
Member

KoBeWi commented Sep 20, 2023

#79920 can also fix this crash (it's not a proper fix for this issue, but it works), so it can be cherry-picked instead.

@YuriSizov
Copy link
Contributor

#79920 can also fix this crash (it's not a proper fix for this issue, but it works), so it can be cherry-picked instead.

Sure, this seems like a good usability fix worth a cherry-pick in and of itself 👍

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