[QFJ-332] Session sendToTarget(Message message, SessionID sessionID) throws NullPointerException Created: 11/Aug/08  Updated: 06/Oct/08  Resolved: 10/Sep/08

Status: Closed
Project: QuickFIX/J
Component/s: Engine
Affects Version/s: 1.3.1
Fix Version/s: 1.3.3

Type: Bug Priority: Default
Reporter: Charlie Zhang Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: None
Environment:

WindowsXP with Java 1.6



 Description   

Here is the excerpt from our application:

try {
...
Session.sendToTarget(message, sessionID);
...
}
catch (SessionNotFound e) {
...
}
catch (XXXException e) {
...
}

the sessionID was set to null due to some reason and we got a NullPointerException

java.lang.NullPointerException
at quickfix.Message.setSessionID(Message.java:423)
at quickfix.Session.sendToTarget(Session.java:454)

But in the sendToTaget method:

public static boolean sendToTarget(Message message, SessionID sessionID)
throws SessionNotFound

{ message.setSessionID(sessionID); Session session = lookupSession(sessionID); if(session == null) throw new SessionNotFound(); else return session.send(message); }

should the message.setSessionID(sessionID) line be put into the else block?


Generated at Mon Apr 29 21:21:12 UTC 2024 using JIRA 7.5.2#75007-sha1:9f5725bb824792b3230a5d8716f0c13e296a3cae.