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 #15873, prevent FontFamily Property was null and crash the whole application #15896

Merged
merged 5 commits into from
Jul 16, 2024

Conversation

Luoyingliang
Copy link
Contributor

What does the pull request do?

this PR fix when FontFamily Property assign a {x:Null} value by xaml, will crash whole application, i added a null check for Typeface.FontFamily.

What is the current behavior?

FontManager will not check the null reference of Typeface.FontFamily null reference, if this property was null, will not fallback to DefaultFontFamily, and crash whole application. I think for the application robustness, it's should be checked.

What is the updated/expected behavior with this PR?

when Typeface.FontFamily property was null, it can fallback to default family

How was the solution implemented (if it's not obvious)?

Add a simple null-coalescing

Fixed issues

Fixes #15873

@Luoyingliang Luoyingliang changed the title fix #15873 fix #15873, prevent FontFamily Property was null and crash the whole application Jun 3, 2024
@avaloniaui-bot
Copy link

You can test this PR using the following package version. 11.2.999-cibuild0048761-alpha. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

@avaloniaui-bot
Copy link

You can test this PR using the following package version. 11.2.999-cibuild0048877-alpha. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

@maxkatz6 maxkatz6 requested a review from Gillibald June 8, 2024 10:05
@avaloniaui-bot
Copy link

You can test this PR using the following package version. 11.2.999-cibuild0050136-alpha. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

@maxkatz6 maxkatz6 added bug backport-candidate-11.1.x Consider this PR for backporting to 11.1 branch labels Jul 16, 2024
@maxkatz6 maxkatz6 merged commit b865cc4 into AvaloniaUI:master Jul 16, 2024
9 of 11 checks passed
@maxkatz6 maxkatz6 added customer-priority Issue reported by a customer with a support agreement. regression backported-11.1.x and removed regression customer-priority Issue reported by a customer with a support agreement. backport-candidate-11.1.x Consider this PR for backporting to 11.1 branch labels Aug 9, 2024
maxkatz6 pushed a commit that referenced this pull request Aug 12, 2024
…application (#15896)

* fix #15873

* fix: FontFamily wrong assignment

* Revert extra whitespaces

---------

Co-authored-by: Benedikt Stebner <Gillibald@users.noreply.github.com>
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.

when set {x:Null} to any control's FontFamily property, application will crashed
4 participants