Fix: Can not select patchset to diff in diff view.

Ibdbcb2 have a NPE hole which make selecting patchset to diff
in diff view run into an error: "The page you requested was not found, or
you do not have permission to view this page.

Change-Id: Id473b36f64d70abd707ee06bb922ea33592fbac2
This commit is contained in:
Bruce Zu
2012-12-03 10:31:24 +08:00
parent ec32548cdc
commit 30a6245cb4

View File

@@ -127,19 +127,19 @@ public class ReviewedPanels {
}
};
InlineHyperlink reviewedLink = null;
int nextUnreviewedPatchIndex =
fileList.getNextPatch(patchIndex, true, unreviewedValidator,
fileList.PREFERENCE_VALIDATOR);
InlineHyperlink reviewedLink = new ChangeLink("", patchKey.getParentKey());
if (fileList != null) {
int nextUnreviewedPatchIndex =
fileList.getNextPatch(patchIndex, true, unreviewedValidator,
fileList.PREFERENCE_VALIDATOR);
if (nextUnreviewedPatchIndex > -1) {
// Create invisible patch link to change page
reviewedLink =
fileList.createLink(nextUnreviewedPatchIndex, patchScreenType,
null, null);
reviewedLink.setText("");
} else {
reviewedLink = new ChangeLink("", patchKey.getParentKey());
if (nextUnreviewedPatchIndex > -1) {
// Create invisible patch link to change page
reviewedLink =
fileList.createLink(nextUnreviewedPatchIndex, patchScreenType,
null, null);
reviewedLink.setText("");
}
}
return reviewedLink;
}