cancel
Showing results for 
Search instead for 
Did you mean: 

NPE while deleting task candidates

cnayak
Champ in-the-making
Champ in-the-making
I am getting a NPE while deleting candidate group when a task has both user and group candidates and is assigned to a user.

Debugging this further, I see that it is failing in the code block below while iterating through identity links when groupId passed in to TaskEntity.deleteIdentityLink method is not null but one of the identity links associated with the task is a user type.

if ((userId != null && userId.equals(identityLinkEntity.getUserId()))
|| (groupId != null && identityLinkEntity.getGroupId().equals(groupId))) {
Context
.getCommandContext()
.getIdentityLinkEntityManager()
.deleteIdentityLink(identityLinkEntity, true);
removedIdentityLinkEntities.add(identityLinkEntity);
}

It is failing on (groupId != null && identityLinkEntity.getGroupId().equals(groupId)) when groupId is passed in but identityLinkEntity being checked is a user so identityLinkEntity.getGroupId() is null. Should this be groupId.equals(identityLinkEntity.getGroupId()) instead ?

Seems like a bug, has this been reported or fixed in a later release - I am using 5.15.

Thanks
2 REPLIES 2

trademak
Star Contributor
Star Contributor
In Activiti 5.16.2 (which is only available in Maven central) and via the Activiti Github releases, this bug should have been fixed. Let us know if this doesn't solve your issue.

Best regards,

cnayak
Champ in-the-making
Champ in-the-making
It has been fixed in 5.16.2. Thanks!