This is an automated email from the ASF dual-hosted git repository.

nightowl888 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/lucenenet.git

commit 595ac605805d3d8739f90b4f9978f8bfaa604713
Author: Shad Storhaug <[email protected]>
AuthorDate: Mon Jun 29 23:48:51 2020 +0700

    Lucene.Net.Support.Collections::ToString(): Fixed overloads to write "null" 
when the collection passed is null rather than throw an exception
---
 src/Lucene.Net/Support/Collections.cs | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/Lucene.Net/Support/Collections.cs 
b/src/Lucene.Net/Support/Collections.cs
index 3dd5373..0dd82ff 100644
--- a/src/Lucene.Net/Support/Collections.cs
+++ b/src/Lucene.Net/Support/Collections.cs
@@ -77,6 +77,9 @@ namespace Lucene.Net.Support
         /// </summary>
         public static string ToString<T>(ICollection<T> collection)
         {
+            if (collection == null)
+                return "null";
+
             if (collection.Count == 0)
             {
                 return "[]";
@@ -121,6 +124,9 @@ namespace Lucene.Net.Support
         /// </summary>
         public static string ToString<TKey, TValue>(IDictionary<TKey, TValue> 
dictionary)
         {
+            if (dictionary == null)
+                return "null";
+
             if (dictionary.Count == 0)
             {
                 return "{}";

Reply via email to