Uploaded image for project: 'QuickFIX/J'
  1. QuickFIX/J
  2. QFJ-332

Session sendToTarget(Message message, SessionID sessionID) throws NullPointerException

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Default
    • Resolution: Fixed
    • Affects Version/s: 1.3.1
    • Fix Version/s: 1.3.3
    • Component/s: Engine
    • 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?

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              charliez Charlie Zhang
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: