Fix NullPointerException in delete-vote REST API
Fix the code which caused the NullPointerException. The commit which broke this: https://gerrit-review.googlesource.com/#/c/93482/ Change-Id: Iedda3900396cd33f7dc40acac47968f493d13e3c
This commit is contained in:
@@ -59,11 +59,11 @@ public class Votes implements ChildCollection<ReviewerResource, VoteResource> {
|
|||||||
public VoteResource parse(ReviewerResource reviewer, IdString id)
|
public VoteResource parse(ReviewerResource reviewer, IdString id)
|
||||||
throws ResourceNotFoundException, OrmException, AuthException,
|
throws ResourceNotFoundException, OrmException, AuthException,
|
||||||
MethodNotAllowedException {
|
MethodNotAllowedException {
|
||||||
if (!reviewer.getRevisionResource().isCurrent()) {
|
if (reviewer.getRevisionResource() != null
|
||||||
|
&& !reviewer.getRevisionResource().isCurrent()) {
|
||||||
throw new MethodNotAllowedException(
|
throw new MethodNotAllowedException(
|
||||||
"Cannot access on non-current patch set");
|
"Cannot access on non-current patch set");
|
||||||
}
|
}
|
||||||
|
|
||||||
return new VoteResource(reviewer, id.get());
|
return new VoteResource(reviewer, id.get());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user