diff --git a/src/Bonsai.Gui.ZedGraph/BoundedGraphPanel.cs b/src/Bonsai.Gui.ZedGraph/BoundedGraphPanel.cs index b1dcd8b..f252df5 100644 --- a/src/Bonsai.Gui.ZedGraph/BoundedGraphPanel.cs +++ b/src/Bonsai.Gui.ZedGraph/BoundedGraphPanel.cs @@ -41,6 +41,10 @@ public int Capacity protected override void OnInvalidated(InvalidateEventArgs e) { + if (GraphPane is null) + { + return; + } double? maxValue = null; var curveList = GraphPane.CurveList; for (int i = 0; i < curveList.Count; i++)