Skip to content

Commit 2d27397

Browse files
committed
Null check on item passed to claim()
1 parent 5d2f4ac commit 2d27397

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

dspace-api/src/main/java/org/dspace/profile/ResearcherProfileServiceImpl.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,10 @@ public ResearcherProfile claim(Context context, EPerson ePerson, URI uri)
200200
public ResearcherProfile claim(Context context, EPerson ePerson, Item item)
201201
throws SQLException, AuthorizeException {
202202

203+
if (item == null) {
204+
throw new IllegalArgumentException("The provided item is null");
205+
}
206+
203207
if (!item.isArchived() || item.isWithdrawn()) {
204208
throw new IllegalArgumentException(
205209
"Only archived items can be claimed to create a researcher profile. Item ID: " + item.getID());

0 commit comments

Comments
 (0)