Skip to content

Commit d75a12a

Browse files
committed
Prevent null ptr exception caused by clicking on variable color of empty line after deleting the existing variable name on the list in Geometry and Plot Watch.
1 parent 4a8e37f commit d75a12a

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Visual_Studio_2017/GraphicalDebugging/GeometryWatchControl.xaml.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -546,7 +546,7 @@ private void colorTextBlock_MouseDown(object sender, System.Windows.Input.MouseB
546546
{
547547
TextBlock textBlock = sender as TextBlock;
548548
GeometryItem geometry = textBlock.DataContext as GeometryItem;
549-
if (geometry.ColorId >= 0)
549+
if (geometry != null && geometry.ColorId >= 0)
550550
{
551551
var color = (textBlock.Background as System.Windows.Media.SolidColorBrush).Color;
552552
var newColor = Util.ShowColorDialog(color);

Visual_Studio_2017/GraphicalDebugging/PlotWatchControl.xaml.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -553,7 +553,7 @@ private void colorTextBlock_MouseDown(object sender, System.Windows.Input.MouseB
553553
{
554554
TextBlock textBlock = sender as TextBlock;
555555
PlotItem geometry = textBlock.DataContext as PlotItem;
556-
if (geometry.ColorId >= 0)
556+
if (geometry != null && geometry.ColorId >= 0)
557557
{
558558
var color = (textBlock.Background as System.Windows.Media.SolidColorBrush).Color;
559559
var newColor = Util.ShowColorDialog(color);

0 commit comments

Comments
 (0)