mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-11-11 00:11:05 +00:00
fix: Handle NullPointerException when adding custom properties to ensure loop continues for other schemas of the same type for addToRegistry (#18088)
This commit is contained in:
parent
1886132f41
commit
b003e1d600
@ -69,10 +69,16 @@ public class TypeRegistry {
|
|||||||
String customPropertyFQN = getCustomPropertyFQN(entityType, propertyName);
|
String customPropertyFQN = getCustomPropertyFQN(entityType, propertyName);
|
||||||
CUSTOM_PROPERTIES.put(customPropertyFQN, customProperty);
|
CUSTOM_PROPERTIES.put(customPropertyFQN, customProperty);
|
||||||
|
|
||||||
|
try {
|
||||||
JsonSchema jsonSchema =
|
JsonSchema jsonSchema =
|
||||||
JsonUtils.getJsonSchema(TYPES.get(customProperty.getPropertyType().getName()).getSchema());
|
JsonUtils.getJsonSchema(
|
||||||
|
TYPES.get(customProperty.getPropertyType().getName()).getSchema());
|
||||||
CUSTOM_PROPERTY_SCHEMAS.put(customPropertyFQN, jsonSchema);
|
CUSTOM_PROPERTY_SCHEMAS.put(customPropertyFQN, jsonSchema);
|
||||||
LOG.info("Adding custom property {} with JSON schema {}", customPropertyFQN, jsonSchema);
|
LOG.info("Adding custom property {} with JSON schema {}", customPropertyFQN, jsonSchema);
|
||||||
|
} catch (Exception e) {
|
||||||
|
CUSTOM_PROPERTIES.remove(customPropertyFQN);
|
||||||
|
LOG.info("Failed to add custom property {}: {}", customPropertyFQN, e.getMessage());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public JsonSchema getSchema(String entityType, String propertyName) {
|
public JsonSchema getSchema(String entityType, String propertyName) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user