added check when the file uploaded is null
This commit is contained in:
parent
58fc9d0d52
commit
f6a0682777
|
@ -484,8 +484,10 @@ public class GeoportalDataEntryServiceImpl extends RemoteServiceServlet implemen
|
||||||
// Iterating on the files upload for the section
|
// Iterating on the files upload for the section
|
||||||
for (int i = 0; i < files.size(); i++) {
|
for (int i = 0; i < files.size(); i++) {
|
||||||
FileUploaded file = files.get(i);
|
FileUploaded file = files.get(i);
|
||||||
|
if (file != null && file.getFilePath() != null) {
|
||||||
String formFieldName = file.getFilePath().getFormFieldLabel();
|
String formFieldName = file.getFilePath().getFormFieldLabel();
|
||||||
LOG.debug("Uploading file: " + file.getFileName() + ", from formFieldName: " + formFieldName);
|
LOG.debug(
|
||||||
|
"Uploading file: " + file.getFileName() + ", from formFieldName: " + formFieldName);
|
||||||
FilePathDV filePath = retrieveFilePathForGcubeProfileFieldName(formFieldName, profile);
|
FilePathDV filePath = retrieveFilePathForGcubeProfileFieldName(formFieldName, profile);
|
||||||
LOG.info("Found {} for the form fieldName {}", filePath, formFieldName);
|
LOG.info("Found {} for the form fieldName {}", filePath, formFieldName);
|
||||||
if (filePath == null) {
|
if (filePath == null) {
|
||||||
|
@ -495,7 +497,8 @@ public class GeoportalDataEntryServiceImpl extends RemoteServiceServlet implemen
|
||||||
}
|
}
|
||||||
|
|
||||||
// Collecting Fileset per Field Definition
|
// Collecting Fileset per Field Definition
|
||||||
FileSetDataObject collFieldDef = collectFilesetPerFieldDef.get(filePath.getFieldDefinition());
|
FileSetDataObject collFieldDef = collectFilesetPerFieldDef
|
||||||
|
.get(filePath.getFieldDefinition());
|
||||||
if (collFieldDef == null) {
|
if (collFieldDef == null) {
|
||||||
collFieldDef = new FileSetDataObject();
|
collFieldDef = new FileSetDataObject();
|
||||||
collFieldDef.setFilePathDV(filePath);
|
collFieldDef.setFilePathDV(filePath);
|
||||||
|
@ -521,6 +524,10 @@ public class GeoportalDataEntryServiceImpl extends RemoteServiceServlet implemen
|
||||||
|
|
||||||
collectFilesetPerFieldDef.put(filePath.getFieldDefinition(), collFieldDef);
|
collectFilesetPerFieldDef.put(filePath.getFieldDefinition(), collFieldDef);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
throw new Exception("Error occurred on uploading file in the section: " + sectionJSONPath
|
||||||
|
+ ". Please upload it/them again and retry");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1138,8 +1145,8 @@ public class GeoportalDataEntryServiceImpl extends RemoteServiceServlet implemen
|
||||||
long groupId = pContext.getCurrentGroupId(this.getThreadLocalRequest());
|
long groupId = pContext.getCurrentGroupId(this.getThreadLocalRequest());
|
||||||
|
|
||||||
if (user == null || scope == null) {
|
if (user == null || scope == null) {
|
||||||
LOG.warn("called readDataEntryPresentationConfig with invalid parameter user: " + user + ", in the scope: "
|
LOG.warn("called readDataEntryPresentationConfig with invalid parameter user: " + user
|
||||||
+ scope, ", returning null");
|
+ ", in the scope: " + scope, ", returning null");
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1284,8 +1291,8 @@ public class GeoportalDataEntryServiceImpl extends RemoteServiceServlet implemen
|
||||||
* @throws Exception the exception
|
* @throws Exception the exception
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public StepPerformedResultDV performActionSteps(String profileID, String projectID, String optionalMessage, ActionDefinitionDV action)
|
public StepPerformedResultDV performActionSteps(String profileID, String projectID, String optionalMessage,
|
||||||
throws Exception {
|
ActionDefinitionDV action) throws Exception {
|
||||||
LOG.info("performActionSteps called for profileID {}, projectID {}, action: " + action, profileID, projectID);
|
LOG.info("performActionSteps called for profileID {}, projectID {}, action: " + action, profileID, projectID);
|
||||||
|
|
||||||
ProjectsCaller client = GeoportalClientCaller.projects();
|
ProjectsCaller client = GeoportalClientCaller.projects();
|
||||||
|
|
Loading…
Reference in New Issue