Bladeren bron

keep to int

Jamie D 5 jaren geleden
bovenliggende
commit
e5647b9299
1 gewijzigde bestanden met toevoegingen van 5 en 1 verwijderingen
  1. 5 1
      Terminal.Gui/Views/ListView.cs

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

@@ -561,7 +561,11 @@ namespace Terminal.Gui {
 		/// <summary>
 		/// <summary>
 		/// Gets the number of items in the <see cref="IList"/>.
 		/// Gets the number of items in the <see cref="IList"/>.
 		/// </summary>
 		/// </summary>
-		public int Count => Convert.ToInt32 (src?.Count);
+		public int Count {
+			get {
+				return src?.Count != null ? src.Count : 0;
+			}
+		}
 
 
 		void RenderUstr (ConsoleDriver driver, ustring ustr, int col, int line, int width)
 		void RenderUstr (ConsoleDriver driver, ustring ustr, int col, int line, int width)
 		{
 		{