diff --git a/openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/TopicRepository.java b/openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/TopicRepository.java index 4708c0f5299..0154d8f3b6f 100644 --- a/openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/TopicRepository.java +++ b/openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/TopicRepository.java @@ -410,9 +410,9 @@ public class TopicRepository extends EntityRepository { updateSchemaFields( "messageSchema.schemaFields", original.getMessageSchema() == null - ? null - : original.getMessageSchema().getSchemaFields(), - updated.getMessageSchema().getSchemaFields(), + ? new ArrayList<>() + : listOrEmpty(original.getMessageSchema().getSchemaFields()), + listOrEmpty(updated.getMessageSchema().getSchemaFields()), EntityUtil.schemaFieldMatch); } recordChange("topicConfig", original.getTopicConfig(), updated.getTopicConfig()); @@ -489,7 +489,10 @@ public class TopicRepository extends EntityRepository { if (updated.getChildren() != null && stored.getChildren() != null) { String childrenFieldName = EntityUtil.getFieldName(fieldName, updated.getName()); updateSchemaFields( - childrenFieldName, stored.getChildren(), updated.getChildren(), fieldMatch); + childrenFieldName, + listOrEmpty(stored.getChildren()), + listOrEmpty(updated.getChildren()), + fieldMatch); } }