Skip to content

Commit

Permalink
Merge pull request serilog#1050 from tsimbalar/resharper-green-take2
Browse files Browse the repository at this point in the history
Fix last ReSharper warning
  • Loading branch information
nblumhardt authored Oct 23, 2017
2 parents c10e625 + 1b4abc4 commit 3cd376c
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/Serilog/Context/LogContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -253,10 +253,8 @@ public DisposableObjectHandle(object o) : base(o)

public override object InitializeLifetimeService()
{
var lease = (ILease)base.InitializeLifetimeService();
// ReSharper disable once PossibleNullReferenceException
// not 100% sure this will never occur ...
lease.Register(LifeTimeSponsor);
var lease = base.InitializeLifetimeService() as ILease;
lease?.Register(LifeTimeSponsor);
return lease;
}

Expand Down

0 comments on commit 3cd376c

Please sign in to comment.