Skip to content

Commit

Permalink
Possible null reference exception fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
abdullah2993 committed Jul 24, 2016
1 parent 5103262 commit 713ef17
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions Server/Core/Networking/Utilities/PooledBufferManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@ public class PooledBufferManager
/// <param name="e">The event arguments.</param>
protected virtual void OnNewBufferAllocated(EventArgs e)
{
if (NewBufferAllocated != null)
NewBufferAllocated(this, e);
var handler = NewBufferAllocated;
if (handler != null)
handler(this, e);
}

/// <summary>
Expand All @@ -38,8 +39,9 @@ protected virtual void OnNewBufferAllocated(EventArgs e)
/// <param name="e">The event arguments.</param>
protected virtual void OnBufferRequested(EventArgs e)
{
if (BufferRequested != null)
BufferRequested(this, e);
var handler =BufferRequested;
if (handler != null)
handler(this, e);
}

/// <summary>
Expand All @@ -52,8 +54,9 @@ protected virtual void OnBufferRequested(EventArgs e)
/// <param name="e">The event arguments.</param>
protected virtual void OnBufferReturned(EventArgs e)
{
if (BufferReturned != null)
BufferReturned(this, e);
var handler = BufferReturned;
if (handler != null)
handler(this, e);
}
#endregion

Expand Down

0 comments on commit 713ef17

Please sign in to comment.