Skip to content

Commit

Permalink
fix workflow failure
Browse files Browse the repository at this point in the history
  • Loading branch information
AssahBismarkabah committed Jan 9, 2025
1 parent c290f98 commit 4d2c212
Showing 1 changed file with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
import org.springframework.stereotype.Service;

import java.text.MessageFormat;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;

Expand All @@ -54,6 +55,11 @@ public void doImport(RealmImport realmImport) {
RealmRepresentation existingRealm = realmRepository.get(realmImport.getRealm());
Map<String, String> customAttributes = existingRealm.getAttributes();

if (customAttributes == null) {
customAttributes = new HashMap<>();
existingRealm.setAttributes(customAttributes);
}

String importChecksum = realmImport.getChecksum();
String attributeKey = getCustomAttributeKey(realmImport);
customAttributes.put(attributeKey, importChecksum);
Expand All @@ -69,6 +75,11 @@ public boolean hasToBeUpdated(RealmImport realmImport) {
}
Map<String, String> customAttributes = existingRealm.getAttributes();

if (customAttributes == null) {
customAttributes = new HashMap<>();
existingRealm.setAttributes(customAttributes);
}

String readChecksum = customAttributes.get(getCustomAttributeKey(realmImport));
if (readChecksum == null) {
return true;
Expand Down

0 comments on commit 4d2c212

Please sign in to comment.