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 for null visual parent. #7298

Merged
merged 1 commit into from
Jan 3, 2022

Conversation

grokys
Copy link
Member

@grokys grokys commented Jan 3, 2022

What does the pull request do?

Fixes an exception in SceneBuilder reported in #6930.

It shouldn't be possible to come across a null visual parent here because the visual should be attached to the visual tree, but according to #6930, it is. Because we don't have a repro here, defensively return a null value instead of throwing if we hit this case.

Also because we don't have a repro, I wasn't able to write a unit test to cover this.

Fixed issues

Fixes #6930.

It shouldn't be possible to come across a null visual parent here because the visual should be attached to the visual tree, but according to #6930, it is. Because we don't have a repro here, defensively return a null value instead of throwing if we hit this case.
@avaloniaui-team
Copy link
Contributor

You can test this PR using the following package version. 0.10.999-cibuild0017672-beta. (feed url: https://nuget.avaloniaui.net/repository/avalonia-all/index.json) [PRBUILDID]

@danwalmsley danwalmsley merged commit a175fbb into master Jan 3, 2022
@danwalmsley danwalmsley deleted the fixes/6930-scenebuilder-no-visual-parent branch January 3, 2022 18:06
grokys added a commit that referenced this pull request Jan 10, 2022
It shouldn't be possible to come across a null visual parent here because the visual should be attached to the visual tree, but according to #6930, it is. Because we don't have a repro here, defensively return a null value instead of throwing if we hit this case.
@Gillibald
Copy link
Contributor

@grokys Are you sure this was backported? I don't see 3aa13a502e4c427c38f39a46aacd1a2b01be63d6 as part of the current release

@grokys
Copy link
Member Author

grokys commented Jan 25, 2022

@grokys
Copy link
Member Author

grokys commented Jan 25, 2022

It was merged on Jan 10 though which is after the last release.

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.

Error: Visual does not have a visual parent leading to a crash
4 participants