ChangeScreen: Expect that current revision can be null

Change-Id: I9f15935bb11e07ac27d367e2bdb2d4e055c8263b
Signed-off-by: Edwin Kempin <ekempin@google.com>
This commit is contained in:
Edwin Kempin
2016-11-18 12:53:59 -08:00
committed by Paladox
parent 3e1d4cde3f
commit 3851d0c0aa
2 changed files with 8 additions and 5 deletions

View File

@@ -435,7 +435,8 @@ public class ChangeScreen extends Screen {
}
private void gotoSibling(int offset) {
if (offset > 0 && changeInfo.currentRevision().equals(revision)) {
if (offset > 0 && changeInfo.currentRevision() != null
&& changeInfo.currentRevision().equals(revision)) {
return;
}

View File

@@ -215,10 +215,12 @@ public class RelatedChanges extends TabPanel {
EnumSet.of(ListChangesOption.CURRENT_REVISION, ListChangesOption.CURRENT_COMMIT),
new TabChangeListCallback(Tab.CHERRY_PICKS, info.project(), revision));
// TODO(sbeller): show only on latest revision
ChangeApi.change(info.legacyId().get()).view("submitted_together")
.get(new TabChangeListCallback(Tab.SUBMITTED_TOGETHER,
info.project(), revision));
if (info.currentRevision() != null
&& info.currentRevision().equals(revision)) {
ChangeApi.change(info.legacyId().get()).view("submitted_together")
.get(new TabChangeListCallback(Tab.SUBMITTED_TOGETHER,
info.project(), revision));
}
if (!Gerrit.info().change().isSubmitWholeTopicEnabled()
&& info.topic() != null && !"".equals(info.topic())) {