Mercurial > hg > ismi-richfaces
diff src/main/java/de/mpiwg/itgroup/ismi/utils/templates/DigitalizationTemplate.java @ 184:135b29621a32
Fix bug with digitalizations having no own value.
author | Robert Casties <casties@mpiwg-berlin.mpg.de> |
---|---|
date | Fri, 27 Jul 2018 14:23:46 +0200 |
parents | 2e911857a759 |
children | 310f512f66af |
line wrap: on
line diff
--- a/src/main/java/de/mpiwg/itgroup/ismi/utils/templates/DigitalizationTemplate.java Tue Jul 03 16:47:16 2018 +0200 +++ b/src/main/java/de/mpiwg/itgroup/ismi/utils/templates/DigitalizationTemplate.java Fri Jul 27 14:23:46 2018 +0200 @@ -67,7 +67,18 @@ return titlesInCodex; } - public int compareTo(DigitalizationTemplate o) { + public int compareTo(DigitalizationTemplate o) { + boolean thisnull = (this.entity == null || this.entity.getOwnValue() == null); + boolean thatnull = (o.entity == null || o.entity.getOwnValue() == null); + if (thisnull && thatnull) { + return 0; + } + if (thisnull) { + return -1; + } + if (thatnull) { + return 1; + } return this.entity.getOwnValue().compareTo(o.getEntity().getOwnValue()); } }