mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2026-01-07 21:16:45 +00:00
Add Null check for source config (#18746)
This commit is contained in:
parent
582a10c831
commit
51f3591714
@ -94,11 +94,14 @@ public class IngestionPipelineRepository extends EntityRepository<IngestionPipel
|
||||
? getLatestPipelineStatus(ingestionPipeline)
|
||||
: ingestionPipeline.getPipelineStatuses());
|
||||
|
||||
JSONObject sourceConfigJson =
|
||||
new JSONObject(JsonUtils.pojoToJson(ingestionPipeline.getSourceConfig().getConfig()));
|
||||
Optional.ofNullable(sourceConfigJson.optJSONObject("appConfig"))
|
||||
.map(appConfig -> appConfig.optString("type", null))
|
||||
.ifPresent(ingestionPipeline::setApplicationType);
|
||||
if (ingestionPipeline.getSourceConfig() != null
|
||||
&& ingestionPipeline.getSourceConfig().getConfig() != null) {
|
||||
JSONObject sourceConfigJson =
|
||||
new JSONObject(JsonUtils.pojoToJson(ingestionPipeline.getSourceConfig().getConfig()));
|
||||
Optional.ofNullable(sourceConfigJson.optJSONObject("appConfig"))
|
||||
.map(appConfig -> appConfig.optString("type", null))
|
||||
.ifPresent(ingestionPipeline::setApplicationType);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user