Skip to content

Commit de99ac6

Browse files
committed
NULL safety
1 parent 7c60b1c commit de99ac6

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

quickfixj-base/src/main/java/quickfix/DataDictionary.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -596,6 +596,7 @@ private static <V> void copyCollection(Collection<V> lhs, Collection<V> rhs) {
596596
* Validate a message, including the header and trailer fields.
597597
*
598598
* @param message the message
599+
* @param settings
599600
* @throws IncorrectTagValue if a field value is not valid
600601
* @throws FieldNotFound if a field cannot be found
601602
* @throws IncorrectDataFormat if a field value has a wrong data type
@@ -610,6 +611,7 @@ public void validate(Message message, ValidationSettings settings) throws Incorr
610611
*
611612
* @param message the message
612613
* @param bodyOnly whether to validate just the message body, or to validate the header and trailer sections as well.
614+
* @param settings
613615
* @throws IncorrectTagValue if a field value is not valid
614616
* @throws FieldNotFound if a field cannot be found
615617
* @throws IncorrectDataFormat if a field value has a wrong data type
@@ -623,7 +625,10 @@ static void validate(Message message, DataDictionary sessionDataDictionary,
623625
DataDictionary applicationDataDictionary, ValidationSettings settings) throws IncorrectTagValue, FieldNotFound,
624626
IncorrectDataFormat {
625627
final boolean bodyOnly = sessionDataDictionary == null;
626-
628+
if (settings == null) {
629+
settings = new ValidationSettings();
630+
}
631+
627632
if (isVersionSpecified(sessionDataDictionary)
628633
&& !sessionDataDictionary.getVersion().equals(
629634
message.getHeader().getString(BeginString.FIELD))

quickfixj-base/src/main/java/quickfix/Message.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -599,6 +599,9 @@ public void fromString(String messageData, DataDictionary sessionDictionary,
599599
if (sessionDictionary.isAdminMessage(MessageUtils.getMessageType(messageData))) {
600600
applicationDictionary = sessionDictionary;
601601
}
602+
if (validationSettings == null) {
603+
validationSettings = new ValidationSettings();
604+
}
602605
parse(messageData, sessionDictionary, applicationDictionary, validationSettings, doValidation, validateChecksum);
603606
}
604607

0 commit comments

Comments
 (0)