Fix minor issue with elastic date parsing

This commit is contained in:
George Kalampokis 2021-12-09 15:11:07 +02:00
parent 17b72cde60
commit 78688420d2
1 changed files with 6 additions and 2 deletions

View File

@ -317,8 +317,12 @@ public class Dmp implements ElasticEntity<Dmp> {
if (fields.get(MapKey.GRANTSTATUS.getName()) != null) { if (fields.get(MapKey.GRANTSTATUS.getName()) != null) {
this.grantStatus = Short.valueOf(fields.get(MapKey.GRANTSTATUS.getName()).toString()); this.grantStatus = Short.valueOf(fields.get(MapKey.GRANTSTATUS.getName()).toString());
} }
this.created = Date.from(Instant.parse(fields.get(MapKey.CREATED.getName()).toString())); if (fields.containsKey(MapKey.CREATED.getName())) {
this.modified = Date.from(Instant.parse(fields.get(MapKey.MODIFIED.getName()).toString())); this.created = Date.from(Instant.parse(fields.get(MapKey.CREATED.getName()).toString()));
}
if (fields.containsKey(MapKey.MODIFIED.getName())) {
this.modified = Date.from(Instant.parse(fields.get(MapKey.MODIFIED.getName()).toString()));
}
if (fields.get(MapKey.FINALIZEDAT.getName()) != null) { if (fields.get(MapKey.FINALIZEDAT.getName()) != null) {
this.finalizedAt = Date.from(Instant.parse(fields.get(MapKey.FINALIZEDAT.getName()).toString())); this.finalizedAt = Date.from(Instant.parse(fields.get(MapKey.FINALIZEDAT.getName()).toString()));
} }