Skip to content

Commit 40d3fb7

Browse files
committed
Fixing null set issue in SqlDataReader?
1 parent d19863d commit 40d3fb7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlDataReader.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5875,7 +5875,7 @@ private void CleanupAfterAsyncInvocationInternal(TdsParserStateObject stateObj,
58755875
stateObj._permitReplayStackTraceToDiffer = false;
58765876
#endif
58775877

5878-
if (_connection?.InnerConnection is SqlConnectionInternal sqlInternalConnection)
5878+
if (_snapshot is not null && _connection?.InnerConnection is SqlConnectionInternal sqlInternalConnection)
58795879
{
58805880
sqlInternalConnection.CachedContexts.TrySetDataReaderSnapshot(_snapshot);
58815881
}

0 commit comments

Comments
 (0)