You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by GitBox <gi...@apache.org> on 2021/07/17 07:53:46 UTC

[GitHub] [kafka] chia7712 commented on a change in pull request #11029: MINOR: Handle some null cases in BrokerMetadataPublisher

chia7712 commented on a change in pull request #11029:
URL: https://github.com/apache/kafka/pull/11029#discussion_r671638916



##########
File path: core/src/main/scala/kafka/server/metadata/BrokerMetadataPublisher.scala
##########
@@ -46,8 +46,10 @@ object BrokerMetadataPublisher {
   def getTopicDelta(topicName: String,
                     newImage: MetadataImage,
                     delta: MetadataDelta): Option[TopicDelta] = {
-    Option(newImage.topics().getTopic(topicName)).map {
-      topicImage => delta.topicsDelta().changedTopic(topicImage.id())
+    Option(newImage.topics().getTopic(topicName)).flatMap {

Review comment:
       Is `newImage.topics()` never null? If so, should we add null check to constructor of `MetadataImage` to make sure input arguments are NOT null.




-- 
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-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org