Skip to content

Commit a49f205

Browse files
authored
Fix NPE (#37382)
1 parent f519eb1 commit a49f205

File tree

3 files changed

+12
-14
lines changed

3 files changed

+12
-14
lines changed

airbyte-integrations/connectors/destination-e2e-test/metadata.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ data:
22
connectorSubtype: unknown
33
connectorType: destination
44
definitionId: 2eb65e87-983a-4fd7-b3e3-9d9dc6eb8537
5-
dockerImageTag: 0.3.3
5+
dockerImageTag: 0.3.4
66
dockerRepository: airbyte/destination-e2e-test
77
githubIssueLabel: destination-e2e-test
88
icon: airbyte.svg

airbyte-integrations/connectors/destination-e2e-test/src/main/java/io/airbyte/integrations/destination/e2e_test/logging/LoggingConsumer.java

+10-13
Original file line numberDiff line numberDiff line change
@@ -52,24 +52,21 @@ public void accept(final AirbyteMessage message) {
5252
if (message.getType() == Type.STATE) {
5353
LOGGER.info("Emitting state: {}", message);
5454
outputRecordCollector.accept(message);
55-
return;
5655
} else if (message.getType() == Type.TRACE) {
5756
LOGGER.info("Received a trace: {}", message);
58-
} else if (message.getType() != Type.RECORD) {
59-
return;
60-
}
57+
} else if (message.getType() == Type.RECORD) {
58+
final AirbyteRecordMessage recordMessage = message.getRecord();
59+
final AirbyteStreamNameNamespacePair pair = AirbyteStreamNameNamespacePair.fromRecordMessage(recordMessage);
6160

62-
final AirbyteRecordMessage recordMessage = message.getRecord();
63-
final AirbyteStreamNameNamespacePair pair = AirbyteStreamNameNamespacePair.fromRecordMessage(recordMessage);
61+
if (!loggers.containsKey(pair)) {
62+
throw new IllegalArgumentException(
63+
String.format(
64+
"Message contained record from a stream that was not in the catalog.\n Catalog: %s\n Message: %s",
65+
Jsons.serialize(configuredCatalog), Jsons.serialize(recordMessage)));
66+
}
6467

65-
if (!loggers.containsKey(pair)) {
66-
throw new IllegalArgumentException(
67-
String.format(
68-
"Message contained record from a stream that was not in the catalog.\n Catalog: %s\n Message: %s",
69-
Jsons.serialize(configuredCatalog), Jsons.serialize(recordMessage)));
68+
loggers.get(pair).log(recordMessage);
7069
}
71-
72-
loggers.get(pair).log(recordMessage);
7370
}
7471

7572
@Override

docs/integrations/destinations/e2e-test.md

+1
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ The OSS and Cloud variants have the same version number starting from version `0
4646

4747
| Version | Date | Pull Request | Subject |
4848
|:--------|:-----------| :------------------------------------------------------- |:----------------------------------------------------------|
49+
| 0.3.4 | 2024-04-16 | [37366](https://github.com/airbytehq/airbyte/pull/37366) | Fix NPE |
4950
| 0.3.3 | 2024-04-16 | [37366](https://github.com/airbytehq/airbyte/pull/37366) | Fix Log trace messages |
5051
| 0.3.2 | 2024-02-14 | [36812](https://github.com/airbytehq/airbyte/pull/36812) | Log trace messages |
5152
| 0.3.1 | 2024-02-14 | [35278](https://github.com/airbytehq/airbyte/pull/35278) | Adopt CDK 0.20.6 |

0 commit comments

Comments
 (0)