Skip to content

Commit

Permalink
Fix: AutoSuggestBox Page crash (#1582)
Browse files Browse the repository at this point in the history
<!--- Provide a general summary of your changes in the Title above -->

## Description
The individual control pages' IconGlyph are all `null`. Causing the
crash in the AutoSuggestBox page.

## Motivation and Context
Closes #1581


## How Has This Been Tested?
Manual.

## Screenshots (if appropriate):

## Types of changes
<!--- What types of changes does your code introduce? Put an `x` in all
the boxes that apply: -->
- [x] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to change)
  • Loading branch information
HO-COOH authored Jul 22, 2024
1 parent f219e4f commit cb323e1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion WinUIGallery/ControlPages/AutoSuggestBoxPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,8 @@ private void SelectControl(ControlInfoDataItem control)
{
ControlDetails.Visibility = Visibility.Visible;

BitmapImage image = new BitmapImage(new Uri(control.IconGlyph));

BitmapImage image = control.IconGlyph == null? null : new BitmapImage(new Uri(control.IconGlyph));
ControlImage.Source = image;

ControlTitle.Text = control.Title;
Expand Down

0 comments on commit cb323e1

Please sign in to comment.