diff --git a/Results/Forms/BatchResultsDlg.cs b/Results/Forms/BatchResultsDlg.cs index c9006c4e1..4593e3367 100644 --- a/Results/Forms/BatchResultsDlg.cs +++ b/Results/Forms/BatchResultsDlg.cs @@ -310,16 +310,19 @@ namespace Results.Forms oneHeight = Math.Max(MinHeight, flowLayoutPanel.Height / metersInOneGroup - 6); } - /// Update size of controls - flowLayoutPanel.SuspendLayout(); - /// - foreach (var oneCtrl in wmRsltsCtrl) + if (wmRsltsCtrl != null) { - oneCtrl.Width = oneWidth; - oneCtrl.Height = oneHeight; + /// Update size of controls + flowLayoutPanel.SuspendLayout(); + /// + foreach (var oneCtrl in wmRsltsCtrl) + { + oneCtrl.Width = oneWidth; + oneCtrl.Height = oneHeight; + } + /// + flowLayoutPanel.ResumeLayout(); } - /// - flowLayoutPanel.ResumeLayout(); } } }