From e20f64fa9a3d662282b45b2aea289e26991568be Mon Sep 17 00:00:00 2001 From: Alan Ren Date: Fri, 16 Dec 2022 08:08:00 -0800 Subject: [PATCH] handle null value (#1790) --- .../QueryExecution/DataStorage/ServiceBufferFileStreamWriter.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Microsoft.SqlTools.ServiceLayer/QueryExecution/DataStorage/ServiceBufferFileStreamWriter.cs b/src/Microsoft.SqlTools.ServiceLayer/QueryExecution/DataStorage/ServiceBufferFileStreamWriter.cs index b57ba636..e6c454f3 100644 --- a/src/Microsoft.SqlTools.ServiceLayer/QueryExecution/DataStorage/ServiceBufferFileStreamWriter.cs +++ b/src/Microsoft.SqlTools.ServiceLayer/QueryExecution/DataStorage/ServiceBufferFileStreamWriter.cs @@ -174,7 +174,7 @@ namespace Microsoft.SqlTools.ServiceLayer.QueryExecution.DataStorage } // Get true type of the object - Type tVal = values[i].GetType(); + Type tVal = values[i] == null ? typeof(DBNull) : values[i].GetType(); // Write the object to a file if (tVal == typeof(DBNull))