Project

General

Profile

« Previous | Next » 

Revision 9425

add checks on archived flag to avoid NPE.

View differences:

metacat-index/src/main/java/edu/ucsb/nceas/metacat/index/SolrIndex.java
539 539
        }
540 540
        String objectPath = null;
541 541
        try {
542
            if(!systemMetadata.getArchived()) {
542
            if (systemMetadata.getArchived() == null || !systemMetadata.getArchived()) {
543 543
                objectPath = DistributedMapsFactory.getObjectPathMap().get(pid);
544 544
            }
545 545
            update(pid, systemMetadata, objectPath);
......
1064 1064
            action = Event.CREATE.xmlValue();
1065 1065
            event.setAction(Event.CREATE);
1066 1066
        }
1067
        else if(systemMetadata.getArchived()) {
1067
        else if(systemMetadata.getArchived() != null && systemMetadata.getArchived()) {
1068 1068
            action = Event.DELETE.xmlValue();
1069 1069
            event.setAction(Event.DELETE);
1070 1070
        } else {

Also available in: Unified diff