Skip to content

Commit 3783604

Browse files
committed
109: ExecuteReader returns a null reference instead of a data reader if the FieldCount is 0 in SqlAnywhere; added a null check for this
1 parent 67f9321 commit 3783604

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

Simple.Data.Ado/ProcedureExecutor.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,8 @@ public IEnumerable<ResultSet> ExecuteReader(IDbCommand command)
7474
command.Connection.Open();
7575
using (var reader = command.ExecuteReader())
7676
{
77-
if (reader.FieldCount > 0)
77+
// Reader isn't always returned - added check to stop NullReferenceException
78+
if ((reader != null) && (reader.FieldCount > 0))
7879
{
7980
return reader.ToMultipleDictionaries();
8081
}

0 commit comments

Comments
 (0)