From 6f5a6898e30cc736721f176763383615e8a6d13d Mon Sep 17 00:00:00 2001 From: ncguilbeault Date: Fri, 19 Apr 2024 16:23:08 +0100 Subject: [PATCH] Return if GraphPane is null --- src/Bonsai.Gui.ZedGraph/BoundedGraphPanel.cs | 4 ++++ 1 file changed, 4 insertions(+) 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++)