From: remillet Date: Tue, 31 Mar 2015 18:12:06 +0000 (-0700) Subject: CSPACE-6375: Added code to prevent NPE when Nuxeo finds a null value for a field... X-Git-Url: https://git.aero2k.de/?a=commitdiff_plain;h=943dfa584146c9a2ce9006f579ad29b11d3d584d;p=tmp%2Fjakarta-migration.git CSPACE-6375: Added code to prevent NPE when Nuxeo finds a null value for a field/property. --- diff --git a/services/blob/service/src/main/java/org/collectionspace/services/blob/nuxeo/BlobDocumentModelHandler.java b/services/blob/service/src/main/java/org/collectionspace/services/blob/nuxeo/BlobDocumentModelHandler.java index cb6c26659..679dce1b8 100644 --- a/services/blob/service/src/main/java/org/collectionspace/services/blob/nuxeo/BlobDocumentModelHandler.java +++ b/services/blob/service/src/main/java/org/collectionspace/services/blob/nuxeo/BlobDocumentModelHandler.java @@ -202,8 +202,8 @@ extends NuxeoDocumentModelHandler { super.extractAllParts(wrapDoc); } - @Override - public void fillAllParts(DocumentWrapper wrapDoc, Action action) throws Exception { + @Deprecated + public void xfillAllParts(DocumentWrapper wrapDoc, Action action) throws Exception { ServiceContext ctx = this.getServiceContext(); BlobInput blobInput = BlobUtil.getBlobInput(ctx); // The blobInput should have been put into the context by the Blob or Media resource if (blobInput != null && blobInput.getBlobFile() != null) { diff --git a/services/common/src/main/java/org/collectionspace/services/nuxeo/util/NuxeoUtils.java b/services/common/src/main/java/org/collectionspace/services/nuxeo/util/NuxeoUtils.java index 1ef9a9dd9..2b4cf2aa0 100644 --- a/services/common/src/main/java/org/collectionspace/services/nuxeo/util/NuxeoUtils.java +++ b/services/common/src/main/java/org/collectionspace/services/nuxeo/util/NuxeoUtils.java @@ -788,6 +788,9 @@ public class NuxeoUtils { throw new IndexOutOfBoundsException("Problem retrieving property {" + xpath + "}:" + ioobe.getLocalizedMessage()); } + } catch (NullPointerException npe) { + logger.error(String.format("Null value found for property %s for document with ID %s", + xpath, docModel.getId()), npe); } return result;