Changeset 30556


Ignore:
Timestamp:
2016-06-02T14:23:21+12:00 (6 years ago)
Author:
kjdon
Message:

check values not null before iterating over them

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/OAIPMH.java

    r30555 r30556  
    556556  protected void addMetadata(Element meta_list_elem, String meta_name, DBInfo info) {
    557557    Vector<String> values = info.getMultiInfo(meta_name);
    558     for (int i=0; i<values.size(); i++) {
    559       addMetadataElement(meta_list_elem, meta_name, values.get(i));
     558    if (values != null && values.size()!=0) {
     559      for (int i=0; i<values.size(); i++) {
     560    addMetadataElement(meta_list_elem, meta_name, values.get(i));
     561      }
    560562    }
    561563  }
Note: See TracChangeset for help on using the changeset viewer.