Commit 94cf7db9ade497fb04283deb876705ce85c3e748

Authored by Tiago Guimarães
1 parent 6e0b3946c7
Exists in DSpace52++

fixing dc.type null pointer exception

dspace-jspui/src/main/java/org/dspace/app/webui/jsptag/ItemTag.java
... ... @@ -473,7 +473,8 @@ public class ItemTag extends TagSupport
473 473 String label = null;
474 474 try
475 475 {
476   - if(field.equals("dc.date.issued") && item.getMetadata("dc.type").endsWith("Thesis"))
  476 + String dctype = item.getMetadata("dc.type");
  477 + if(field.equals("dc.date.issued") && dctype != null && dctype.endsWith("Thesis"))
477 478 label = I18nUtil.getMessage("metadata."
478 479 + ("default".equals(this.style) ? "" : this.style + ".") + field + "_thesis",
479 480 context);
... ... @@ -486,7 +487,8 @@ public class ItemTag extends TagSupport
486 487 {
487 488 // if there is not a specific translation for the style we
488 489 // use the default one
489   - if(field.equals("dc.date.issued") && item.getMetadata("dc.type").endsWith("Thesis"))
  490 + String dctype = item.getMetadata("dc.type");
  491 + if(field.equals("dc.date.issued") && dctype != null && dctype.endsWith("Thesis"))
490 492 label = LocaleSupport.getLocalizedMessage(pageContext,
491 493 "metadata." + field + "_thesis");
492 494 else
... ...