Skip to content

Commit

Permalink
Handle DBNull to fix log issues (#2191)
Browse files Browse the repository at this point in the history
  • Loading branch information
bcarthic authored Dec 16, 2022
1 parent 1ebe9a7 commit 90bc0fd
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ public override async Task<long> GetMaxDeletedChangeFeedWatermarkAsync(DateTime
using SqlCommandWrapper sqlCommandWrapper = sqlConnectionWrapper.CreateRetrySqlCommand();

VLatest.GetMaxDeletedChangeFeedWatermark.PopulateCommand(sqlCommandWrapper, timeStamp);
var maxSequence = (long?)(await sqlCommandWrapper.ExecuteScalarAsync(cancellationToken));
var maxSequence = await sqlCommandWrapper.ExecuteScalarAsync(cancellationToken);

return maxSequence.GetValueOrDefault();
return maxSequence != null && maxSequence != DBNull.Value ? (long)maxSequence : default;
}
}

0 comments on commit 90bc0fd

Please sign in to comment.