PostReview: Fix NPE on file level comments

The line member is optional and can be null for file level comments.

Change-Id: I77772b6f80772d5161eaa7db278ffc80c3560056
This commit is contained in:
Shawn Pearce
2015-01-12 10:31:02 -08:00
parent 4c725ccc08
commit 2a2fa306f9

View File

@@ -317,7 +317,7 @@ public class PostReview implements RestModifyView<RevisionResource, ReviewInput>
listItr.remove();
continue;
}
if (c.line < 0) {
if (c.line != null && c.line < 0) {
throw new BadRequestException(String.format(
"negative line number %d not allowed on %s",
c.line, path));