diff --git a/dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/deprecated/tracker/importer/shared/postprocess/EventFileResourcePostProcessor.java b/dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/deprecated/tracker/importer/shared/postprocess/EventFileResourcePostProcessor.java index b3fd250d9630..fc036d09a0e0 100644 --- a/dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/deprecated/tracker/importer/shared/postprocess/EventFileResourcePostProcessor.java +++ b/dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/deprecated/tracker/importer/shared/postprocess/EventFileResourcePostProcessor.java @@ -51,7 +51,8 @@ public void process(Event event, WorkContext ctx) { if (dataElement.isFileType()) { FileResource fileResource = fileResourceService.getFileResource(dataValue.getValue()); - if (!fileResource.isAssigned() || fileResource.getFileResourceOwner() == null) { + if (fileResource != null + && (!fileResource.isAssigned() || fileResource.getFileResourceOwner() == null)) { fileResource.setAssigned(true); fileResource.setFileResourceOwner(event.getEvent()); fileResourceService.updateFileResource(fileResource);