mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-07 01:54:22 +00:00
Fix NullPointerException. Only return userid if EPerson not null
(cherry picked from commit f34c592352
)
This commit is contained in:

committed by
github-actions[bot]
![github-actions[bot]](/assets/img/avatar_default.png)
parent
606b10ccb7
commit
448a69483b
@@ -14,7 +14,6 @@ import org.dspace.app.rest.model.ProcessRest;
|
||||
import org.dspace.app.rest.projection.Projection;
|
||||
import org.dspace.scripts.Process;
|
||||
import org.dspace.scripts.service.ProcessService;
|
||||
import org.hibernate.ObjectNotFoundException;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.stereotype.Component;
|
||||
@@ -40,10 +39,8 @@ public class ProcessConverter implements DSpaceConverter<Process, ProcessRest> {
|
||||
processRest.setId(process.getID());
|
||||
processRest.setScriptName(process.getName());
|
||||
processRest.setProcessId(process.getID());
|
||||
try {
|
||||
if (process.getEPerson() != null) {
|
||||
processRest.setUserId(process.getEPerson().getID());
|
||||
} catch (ObjectNotFoundException e ) {
|
||||
processRest.setUserId(null);
|
||||
}
|
||||
processRest.setProcessStatus(process.getProcessStatus());
|
||||
processRest.setStartTime(process.getStartTime());
|
||||
|
Reference in New Issue
Block a user