-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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 editor crash when unsupported Resource
is dropped in scene
#89126
Conversation
335d1e5
to
5f2abd9
Compare
CC @ryevdokimov |
I also fixed an issue that when dropping a scene into itself (cyclic dependency) would create an undo-redo history action and display "Create Node" in the godot diagnostics window; I found it while testing this and it's shown here: #89106 (comment) (in my old PR that is now superseded by this PR). It now behaves like this: godot.windows.editor.x86_64_0s6IjBqK0L.mp4The only downside is that there is no easy way to display the "cyclic dependency" error that I know of (that doesn't pollute the logs). Can I include this change in this PR, too? It's related. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good.
2024-03-04.08-24-20.mp4
Any comment on my last message @ryevdokimov / @KoBeWi ? I haven't included the changes to avoid dropping cyclic dependencies as I found a fix after the fact |
I think that fix should go to separate PR, unless it's closely related. |
It's a change on the same |
5f2abd9
to
c0467aa
Compare
I think that other change should be in |
Edit: sorry, didn't see your latest comment. I did try doing it there, but I failed. Will look into it with more time later. To keep this simple and prioritize the crash fix, I'll leave it as is. Once this is merged I can create a PR for the change I'm describing |
Thanks! |
Match #89126 for 3D: check for `Resource` type instead of extension
Follow up on #89106
Change
CanvasItemEditorViewport::can_drop_data
to check if files are validResource
types (PackedScene
orTexture2D
) instead of checking for extension types (where.tres
is valid forTexture2D
but it's not an exclusive extension for it).Change safeguard check from #89106 to an error message as suggested. Though, from my testing I can't seem to trigger this error message as the
Resource
type check handles this, too.Changed nested
if
statements to exit immediately to avoid unnecessary code nesting.Also fixes #89093, so it actually supersedes #89106