Browse Source

Prevent System.NullReferenceException.

BDisp 1 year ago
parent
commit
d7b0899f2b
1 changed files with 1 additions and 1 deletions
  1. 1 1
      Terminal.Gui/Views/ListView.cs

+ 1 - 1
Terminal.Gui/Views/ListView.cs

@@ -848,7 +848,7 @@ namespace Terminal.Gui {
 
 
 		void CheckAndResizeMarksIfRequired ()
 		void CheckAndResizeMarksIfRequired ()
 		{
 		{
-			if (count != src.Count) {
+			if (src != null && count != src.Count) {
 				count = src.Count;
 				count = src.Count;
 				BitArray newMarks = new BitArray (count);
 				BitArray newMarks = new BitArray (count);
 				for (var i = 0; i < Math.Min (marks.Length, newMarks.Length); i++) {
 				for (var i = 0; i < Math.Min (marks.Length, newMarks.Length); i++) {