# HG changeset patch # User casties # Date 1474903543 -7200 # Node ID e07e9f5afaa312a52385233b750c43b16f2e0acd # Parent c000b4b386bce817b21bd4aed6728c2e8d36298d fix display bug when WITNESS has no CODEX. diff -r c000b4b386bc -r e07e9f5afaa3 src/main/java/de/mpiwg/itgroup/ismi/search/beans/DisplayBean.java --- a/src/main/java/de/mpiwg/itgroup/ismi/search/beans/DisplayBean.java Wed Sep 21 19:53:15 2016 +0200 +++ b/src/main/java/de/mpiwg/itgroup/ismi/search/beans/DisplayBean.java Mon Sep 26 17:25:43 2016 +0200 @@ -68,14 +68,16 @@ for (Entity witness : allwits) { // get CODEX for WITNESS List codices = getWrapper().getTargetsForSourceRelation(witness.getId(), is_part_of, CODEX, 1); - Entity codex = codices.get(0); - // Attribute pub = getWrapper().getAttributeByName(codex.getId(), "public"); - // if (pub == null || ! pub.getValue().equals("true")) { - // look at DIGITALIZATION - List digis = getWrapper().getSourcesForTargetRelation(codex.getId(), is_digitalization_of, DIGITALIZATION, 1); - hasScans = !digis.isEmpty(); - if (this.showWitnessesWithScans && !hasScans) { - continue; + if (codices.isEmpty()) { + logger.error("WITNESS ["+witness.getId()+"] has no CODEX!"); + } else { + Entity codex = codices.get(0); + // look at DIGITALIZATION of CODEX + List digis = getWrapper().getSourcesForTargetRelation(codex.getId(), is_digitalization_of, DIGITALIZATION, 1); + hasScans = !digis.isEmpty(); + if (this.showWitnessesWithScans && !hasScans) { + continue; + } } String witlabel = witness.getOwnValue() + " [" + witness.getId() + "]" + (hasScans ? "+S" : ""); SelectItem0 item = new SelectItem0(witness.getId(), witlabel, true);