Skip to content

Commit

Permalink
Update topics.split to be after null check
Browse files Browse the repository at this point in the history
  • Loading branch information
mwodahl committed Jul 16, 2024
1 parent 0d24528 commit a8ea78d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/main/java/jpo/sdw/depositor/DepositorProperties.java
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,12 @@ void initialize() {
if (getSubscriptionTopics() == null || getSubscriptionTopics().length == 0) {
// get environment variable SDW_SUBSCRIPTION_TOPIC
String topics = System.getenv("SDW_SUBSCRIPTION_TOPIC");
subscriptionTopics = topics.split(",");
if (topics == null || topics.isEmpty()) {
topics = String.join(",", DEFAULT_SUBSCRIPTION_TOPICS);
logger.info("No Kafka subscription topics specified in configuration, defaulting to {}", topics);
subscriptionTopics = DEFAULT_SUBSCRIPTION_TOPICS;
} else {
subscriptionTopics = topics.split(",");
}
}

Expand Down

0 comments on commit a8ea78d

Please sign in to comment.