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/20 18:10:57 UTC

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

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



##########
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:
       There's just two usages of this constructor and they cannot provide nulls, so we can probably live without the null check




-- 
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