Skip to content

Commit

Permalink
JBPAPP-7829 fixing NPE on Security Test
Browse files Browse the repository at this point in the history
  • Loading branch information
clebertsuconic committed Jan 5, 2012
1 parent 6a87570 commit 22a4266
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/main/org/hornetq/core/server/impl/ServerSessionImpl.java
Expand Up @@ -1105,12 +1105,17 @@ public void sendLarge(final MessageInternal message) throws Exception
public void send(final ServerMessage message, final boolean direct) throws Exception
{
long id = storageManager.generateUniqueID();

SimpleString address = message.getAddress();

message.setMessageID(id);
message.encodeMessageIDToBuffer();

if (defaultAddress == null && address != null)
{
defaultAddress = address;
}

if (address == null)
{
if (message.isDurable())
Expand All @@ -1131,6 +1136,7 @@ public void send(final ServerMessage message, final boolean direct) throws Excep
log.trace("send(message=" + message + ", direct=" + direct + ") being called");
}

log.info("message " + message + " managementAddress = " + managementAddress);
if (message.getAddress().equals(managementAddress))
{
// It's a management message
Expand All @@ -1141,11 +1147,6 @@ public void send(final ServerMessage message, final boolean direct) throws Excep
{
doSend(message, direct);
}

if (defaultAddress == null)
{
defaultAddress = address;
}
}

public void sendContinuations(final int packetSize,
Expand Down

0 comments on commit 22a4266

Please sign in to comment.