Skip to content

Commit

Permalink
修复ExecuteTrans回滚rollback委托为null时异常;
Browse files Browse the repository at this point in the history
  • Loading branch information
zqlovejyc committed Jan 20, 2021
1 parent 92f4ece commit bada8bc
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions SQLBuilder.Core/Repositories/BaseRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,9 @@ public virtual bool ExecuteTrans(Func<IRepository, bool> handler, Action<Excepti
else
{
repository.Rollback();
rollback?.Invoke(null);

if (rollback != null)
rollback(null);
}

return res;
Expand Down Expand Up @@ -241,7 +243,9 @@ public virtual async Task<bool> ExecuteTransAsync(Func<IRepository, Task<bool>>
else
{
repository.Rollback();
await rollback?.Invoke(null);

if (rollback != null)
await rollback(null);
}

return res;
Expand Down

0 comments on commit bada8bc

Please sign in to comment.