Skip to content

Commit cb323e1

Browse files
authored
Fix: AutoSuggestBox Page crash (#1582)
<!--- 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)
1 parent f219e4f commit cb323e1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

WinUIGallery/ControlPages/AutoSuggestBoxPage.xaml.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,8 @@ private void SelectControl(ControlInfoDataItem control)
234234
{
235235
ControlDetails.Visibility = Visibility.Visible;
236236

237-
BitmapImage image = new BitmapImage(new Uri(control.IconGlyph));
237+
238+
BitmapImage image = control.IconGlyph == null? null : new BitmapImage(new Uri(control.IconGlyph));
238239
ControlImage.Source = image;
239240

240241
ControlTitle.Text = control.Title;

0 commit comments

Comments
 (0)