Details
-
Bug
-
Resolution: Fixed
-
Low
-
None
-
None
-
None
Description
Recipe to reproduce:
- Create a review, and add a user
- Remove the user from Crucible via the User Admin
- View the Review
- Click: Edit Details
- Click: Add Content
- Get this NPE
Caused by: java.lang.NullPointerException at com.cenqua.crucible.model.managers.LogManager$Builder.entityId(LogManager.java:534) at com.cenqua.crucible.model.managers.LogManager.logReviewReviewerAdd(LogManager.java:323) at com.atlassian.crucible.actions.create.EditReviewDetailsAction.execute(EditReviewDetailsAction.java:352) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at com.opensymphony.xwork.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:358)
TODO:
- Why is an EditReviewDetailsAction triggering a com.cenqua.crucible.model.managers.LogManager.logReviewReviewerAdd method call, when no new reviewers are added to the review ?
- The bug lies in the logic here:
if (projectManager.isAllowedReviewer(project, user)) { if (!newParticipants.containsKey(user)) { newParticipants.put(user, new ReviewParticipant.ParticipantsRoles(user, true, false, false)); } updated = true; LogManager.logReviewReviewerAdd(review, getCurrentUser(), user, review.getState().isReviewState());
This was introduced here: https://fisheye.dev.internal.atlassian.com/changelog/FE-hg?cs=838f12aea28b8d878394806681768a74a9f323af with the refactor to use: getActiveUser over getUserById. activeUser returns null if the username is not found or not active.
Then the reviewers set allows null, and must contain a null user.... hence the contains method, returns null.