mirror of https://github.com/apache/nifi.git
NIFI-9054 Calling Nifi Registry's createExtensionBundleVersion REST endpoint will cause NullPointerException (#5309)
Co-authored-by: Robert Kalmar <rkalmar@cloudera.com>
This commit is contained in:
parent
c2c3727dd5
commit
388b79d1ee
|
@ -333,10 +333,12 @@ public class StandardExtensionService implements ExtensionService {
|
|||
extensionEntity.setId(UUID.randomUUID().toString());
|
||||
extensionEntity.setBundleVersionId(versionEntity.getId());
|
||||
|
||||
extensionEntity.getRestrictions().forEach(r -> {
|
||||
r.setId(UUID.randomUUID().toString());
|
||||
r.setExtensionId(extensionEntity.getId());
|
||||
});
|
||||
if (extensionEntity.getRestrictions() != null) {
|
||||
extensionEntity.getRestrictions().forEach(r -> {
|
||||
r.setId(UUID.randomUUID().toString());
|
||||
r.setExtensionId(extensionEntity.getId());
|
||||
});
|
||||
}
|
||||
|
||||
extensionEntity.getProvidedServiceApis().forEach(p -> {
|
||||
p.setId(UUID.randomUUID().toString());
|
||||
|
|
|
@ -210,12 +210,10 @@ public class ExtensionMappings {
|
|||
entity.setProvidedServiceApis(Collections.emptySet());
|
||||
}
|
||||
|
||||
if (extension.getRestricted() != null) {
|
||||
if (extension.getRestricted().getRestrictions() != null) {
|
||||
entity.setRestrictions(extension.getRestricted().getRestrictions().stream()
|
||||
.map(r -> map(r))
|
||||
.collect(Collectors.toSet()));
|
||||
}
|
||||
if (extension.getRestricted() != null && extension.getRestricted().getRestrictions() != null) {
|
||||
entity.setRestrictions(extension.getRestricted().getRestrictions().stream()
|
||||
.map(r -> map(r))
|
||||
.collect(Collectors.toSet()));
|
||||
} else {
|
||||
entity.setRestrictions(Collections.emptySet());
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue