Skip to content

Commit 8272585

Browse files
Fix potential null reference issue with re-templated InfiniteCanvas
1 parent 8ade803 commit 8272585

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Microsoft.Toolkit.Uwp.UI.Controls/InfiniteCanvas/InfiniteCanvas.TextBox.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,10 @@ private void CanvasTextBoxColorPicker_ColorChanged(ColorPicker sender, ColorChan
116116
ReDrawCanvas();
117117
}
118118

119-
_fontColorIcon.Foreground = new SolidColorBrush(_canvasTextBoxColorPicker.Color);
119+
if (_fontColorIcon != null)
120+
{
121+
_fontColorIcon.Foreground = new SolidColorBrush(_canvasTextBoxColorPicker.Color);
122+
}
120123
}
121124

122125
private void CanvasTextBox_TextChanged(object sender, string text)

0 commit comments

Comments
 (0)