Skip to content

Commit 5a807f8

Browse files
fix: Check if stream can seek during import (#36)
1 parent aa1df5a commit 5a807f8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/VirtoCommerce.ImportModule.CsvHelper/CsvDataReader.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,10 @@ public virtual async Task<int> GetTotalCountAsync(ImportContext context)
5656
return _totalCount.Value;
5757
}
5858

59-
var streamPosition = _stream.Position;
59+
var streamPosition = 0L;
6060
if (_stream.CanSeek)
6161
{
62+
streamPosition = _stream.Position;
6263
_stream.Seek(0, SeekOrigin.Begin);
6364
}
6465

0 commit comments

Comments
 (0)