From 263d37b5264ca6887776d976e52e01c4942f63d4 Mon Sep 17 00:00:00 2001 From: Priyanka Tiwari Date: Mon, 22 Dec 2025 14:53:05 +0530 Subject: [PATCH] Fix for nullreference exception --- .../src/Microsoft/Data/SqlClient/SqlCommand.Encryption.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlCommand.Encryption.cs b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlCommand.Encryption.cs index cf90d29632..120bba6ead 100644 --- a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlCommand.Encryption.cs +++ b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlCommand.Encryption.cs @@ -1293,7 +1293,7 @@ private SqlDataReader TryFetchInputParameterEncryptionInfo( // not present as the rpcName, as is the case with non-_batchRPCMode. So // input parameters start at parameters[1]. parameters[0] is the actual // T-SQL Statement. rpcName is sp_executesql. - if (_RPCList[i].systemParams.Length > 1) + if (_RPCList[i].systemParams != null && _RPCList[i].systemParams.Length > 1) { _RPCList[i].needsFetchParameterEncryptionMetadata = true;