Skip to content

Commit

Permalink
fix for NPE on session lookup which causes test failures
Browse files Browse the repository at this point in the history
  • Loading branch information
jonfreedman authored Dec 1, 2017
1 parent ee3101e commit 67f5dbe
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions quickfixj-core/src/main/java/quickfix/MemoryStore.java
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,8 @@ public void setNextTargetMsgSeqNum(int next) throws IOException {
public void refresh() throws IOException {
// IOException is declared to maintain strict compatibility with QF JNI
final String text = "memory store does not support refresh!";
if (sessionID != null) {
Session session = Session.lookupSession(sessionID);
final Session session = sessionID != null ? Session.lookupSession(sessionID) : null;
if (session != null) {
session.getLog().onErrorEvent("ERROR: " + text);
} else {
LoggerFactory.getLogger(MemoryStore.class).error(text);
Expand Down

0 comments on commit 67f5dbe

Please sign in to comment.