Author: jgomes
Date: Thu Sep 29 18:27:31 2011
New Revision: 1177390
URL: http://svn.apache.org/viewvc?rev=1177390&view=rev
Log:
Add null check.
Fixes [AMQNET-339]. (See https://issues.apache.org/jira/browse/AMQNET-339)
Modified:
activemq/activemq-dotnet/Apache.NMS.ActiveMQ/branches/1.5.x/src/main/csharp/Transport/InactivityMonitor.cs
Modified:
activemq/activemq-dotnet/Apache.NMS.ActiveMQ/branches/1.5.x/src/main/csharp/Transport/InactivityMonitor.cs
URL:
http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.ActiveMQ/branches/1.5.x/src/main/csharp/Transport/InactivityMonitor.cs?rev=1177390&r1=1177389&r2=1177390&view=diff
==============================================================================
---
activemq/activemq-dotnet/Apache.NMS.ActiveMQ/branches/1.5.x/src/main/csharp/Transport/InactivityMonitor.cs
(original)
+++
activemq/activemq-dotnet/Apache.NMS.ActiveMQ/branches/1.5.x/src/main/csharp/Transport/InactivityMonitor.cs
Thu Sep 29 18:27:31 2011
@@ -144,7 +144,11 @@ namespace Apache.NMS.ActiveMQ.Transport
if(!commandSent.Value)
{
Tracer.DebugFormat("InactivityMonitor[{0}]: No
Message sent since last write check. Sending a KeepAliveInfo.", instanceId);
- this.asyncWriteTask.IsPending = true;
+ if(null != this.asyncWriteTask)
+ {
+ this.asyncWriteTask.IsPending = true;
+ }
+
this.asyncTasks.Wakeup();
}
else
@@ -179,7 +183,11 @@ namespace Apache.NMS.ActiveMQ.Transport
if(!commandReceived.Value)
{
Tracer.DebugFormat("InactivityMonitor[{0}]: No
message received since last read check! Sending an InactivityException!",
instanceId);
- this.asyncErrorTask.IsPending = true;
+ if(null != this.asyncErrorTask)
+ {
+ this.asyncErrorTask.IsPending = true;
+ }
+
this.asyncTasks.Wakeup();
}
else