Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Copy link

Copilot AI Dec 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The null check added here is correct and necessary to prevent NullReferenceException in batch scenarios. However, there doesn't appear to be a test case that covers this specific scenario - batching with Always Encrypted where systemParams could be null. Consider adding a test that exercises this code path to prevent regression.

Copilot uses AI. Check for mistakes.
{
_RPCList[i].needsFetchParameterEncryptionMetadata = true;

Expand Down
Loading