Skip to content
Permalink
Browse files
Fix a potential NPE
  • Loading branch information
Timothy A. Bish committed Jan 10, 2011
1 parent 0ece378 commit e87fcbd26734521323dcf46c07d87f833461c4b3
Showing 1 changed file with 2 additions and 4 deletions.
@@ -150,15 +150,13 @@ public void ReadCheck()

if(!AllowReadCheck(elapsed))
{
Tracer.Debug("Inactivity Monitor: A read check is not currently allowed.");
return;
}

this.lastReadCheckTime = now;

if(this.inRead.Value || this.failed.Value)
if(this.inRead.Value || this.failed.Value || this.asyncErrorTask == null)
{
Tracer.Debug("A receive is in progress or already failed.");
return;
}

@@ -182,7 +180,7 @@ public void ReadCheck()
/// <returns></returns>
public bool AllowReadCheck(TimeSpan elapsed)
{
return (elapsed.TotalMilliseconds > readCheckTime );
return (elapsed.TotalMilliseconds > readCheckTime);
}
#endregion

0 comments on commit e87fcbd

Please sign in to comment.