Skip to content

Commit

Permalink
Fix CodeQA warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
nathan130200 committed May 6, 2024
1 parent a0173e5 commit b3ef0ff
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions XmppSharp/XmppParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ public sealed class XmppParser : IDisposable


private readonly bool _leaveOpen;
private readonly Func<Stream> _streamFactory;
private Func<Stream> _streamFactory;
private Stream _baseStream;
private bool _isFromFactory;
private readonly bool _isFromFactory;

private readonly Encoding _encoding;
private readonly int _bufferSize;
Expand Down Expand Up @@ -58,8 +58,8 @@ public XmppParser(Func<Stream> streamFactory, Encoding? encoding = default, int
{
Require.NotNull(streamFactory);

this._streamFactory = streamFactory;
this._isFromFactory = true;
this._streamFactory = streamFactory;

Reset();
}
Expand Down Expand Up @@ -89,7 +89,9 @@ public void Dispose()

this._disposed = true;

if (!this._isFromFactory)
if (this._isFromFactory)
this._streamFactory = null;
else
{
if (!this._leaveOpen)
this._baseStream?.Dispose();
Expand Down

0 comments on commit b3ef0ff

Please sign in to comment.