Skip to content

Commit

Permalink
Fast fix for NullRefException from FileAppender
Browse files Browse the repository at this point in the history
  • Loading branch information
erikmav committed Mar 8, 2024
1 parent 3877e0b commit e8ee75d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/log4net/Appender/FileAppender.cs
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ private LockStateException(SerializationInfo info, StreamingContext context) : b
}

private Stream m_realStream = null;
private LockingModelBase m_lockingModel = null;
private readonly LockingModelBase m_lockingModel;
private int m_lockLevel = 0;

public LockingStream(LockingModelBase locking)
Expand Down Expand Up @@ -1306,7 +1306,7 @@ protected override void Reset()
protected override void OnClose()
{
base.OnClose();
m_lockingModel.OnClose();
m_lockingModel?.OnClose();
}

/// <summary>
Expand Down

0 comments on commit e8ee75d

Please sign in to comment.