Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Descriptive metadata form with separators gives NPE on clicking raw XML button #1215

Closed
luis100 opened this issue Apr 27, 2018 · 0 comments
Closed
Assignees
Labels
Milestone

Comments

@luis100
Copy link
Member

luis100 commented Apr 27, 2018

Steps to reproduce:

  1. Create a new AIP with desc. metadata of type EAD 2002
  2. Edit the desc. metadata and click the see raw XML button on the top-left
  3. Check error on the JS console.

NullPointerException happens on EditDescriptiveMetadata.java:394

  private boolean hasModifiedForm() {
    HashMap<String, MetadataValue> formMap = new HashMap<>();
    for (MetadataValue mv : supportedBundle.getValues()) {
      formMap.put(mv.getId(), mv);
    }
    HashMap<String, MetadataValue> bundleMap = new HashMap<>();
    for (MetadataValue mv : bundle.getValues()) {
      bundleMap.put(mv.getId(), mv);
    }
    for (Entry<String, MetadataValue> entry : formMap.entrySet()) {
      String key = entry.getKey();
      MetadataValue mvForm = entry.getValue();
      String formValue = mvForm != null ? mvForm.get("value") : "";
      MetadataValue mvBundle = bundleMap.get(key);
      String bundleValue = mvBundle != null ? bundleMap.get(key).get("value") : "";

      if (!formValue.equals(bundleValue)) // <<<< HERE
        return true;
    }
    return false;
  }

This is because formValue and bundleValue are both null.

@luis100 luis100 added the bug label Apr 27, 2018
@luis100 luis100 added this to the 2.2.2 milestone Apr 27, 2018
@luis100 luis100 self-assigned this Apr 27, 2018
luis100 added a commit that referenced this issue Apr 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant