OPEN: Fix crash for items without copies
@@ -660,13 +660,15 @@ public class Open extends BaseApi implements OpacApi {
// Copies
Element table = doc.select("table[id$=grdViewMediumCopies]").first();
+ if (table != null) {
Elements trs = table.select("tr");
List<String> columnmap = new ArrayList<>();
for (Element th : trs.first().select("th")) {
columnmap.add(getCopyColumnKey(th.text()));
}
- DateTimeFormatter fmt = DateTimeFormat.forPattern("dd.MM.yyyy").withLocale(Locale.GERMAN);
+ DateTimeFormatter fmt =
+ DateTimeFormat.forPattern("dd.MM.yyyy").withLocale(Locale.GERMAN);
for (int i = 1; i < trs.size(); i++) {
Elements tds = trs.get(i).select("td");
Copy copy = new Copy();
@@ -678,6 +680,7 @@ public class Open extends BaseApi implements OpacApi {
}
item.addCopy(copy);
}
+ }
return item;
}
