avoid any potential NPE and try again.

git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@1304057 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Timothy A. Bish 2012-03-22 21:00:17 +00:00
parent 1463bec066
commit d92d3a8a06
1 changed files with 6 additions and 0 deletions

View File

@ -145,6 +145,9 @@ public class FailoverTransport implements CompositeTransport {
if (priorityBackup && !connectedToPriority) {
try {
doDelay();
if (reconnectTask == null) {
return true;
}
reconnectTask.wakeup();
} catch (InterruptedException e) {
LOG.debug("Reconnect task has been interrupted.", e);
@ -154,6 +157,9 @@ public class FailoverTransport implements CompositeTransport {
// build backups on the next iteration
buildBackup = true;
try {
if (reconnectTask == null) {
return true;
}
reconnectTask.wakeup();
} catch (InterruptedException e) {
LOG.debug("Reconnect task has been interrupted.", e);