FrankYang0529 commented on code in PR #15458: URL: https://github.com/apache/kafka/pull/15458#discussion_r1510195954
########## tools/src/main/java/org/apache/kafka/tools/TopicCommand.java: ########## @@ -210,7 +210,7 @@ private static Integer getReplicationFactor(TopicPartitionInfo tpi, PartitionRea */ private static void ensureTopicExists(List<String> foundTopics, String requestedTopic, Boolean requireTopicExists) { // If no topic name was mentioned, do not need to throw exception. - if (!(requestedTopic.isEmpty() || !Optional.ofNullable(requestedTopic).isPresent()) && requireTopicExists && foundTopics.isEmpty()) { + if (requestedTopic != null && !requestedTopic.isEmpty() && requireTopicExists && foundTopics.isEmpty()) { Review Comment: Updated it. Thanks. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: jira-unsubscr...@kafka.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org