Merge "Clear 'Old Version History' ListBox before populating it"
diff --git a/gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/ChangeScreen.java b/gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/ChangeScreen.java
index 5d0966d..509f34c 100644
--- a/gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/ChangeScreen.java
+++ b/gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/ChangeScreen.java
@@ -98,14 +98,6 @@
   public ChangeScreen(final Change.Id toShow) {
     changeId = toShow;
     openPatchSetId = null;
-
-    // If we have any diff stored, make sure they are applicable to the
-    // current change, discard them otherwise.
-    //
-    if (currentChangeId != null && !currentChangeId.equals(toShow)) {
-      diffBaseId = null;
-    }
-    currentChangeId = toShow;
   }
 
   public ChangeScreen(final PatchSet.Id toShow) {
@@ -271,6 +263,7 @@
 
   private void display(final ChangeDetail detail) {
     displayTitle(detail.getChange().getKey(), detail.getChange().getSubject());
+    discardDiffBaseIfNotApplicable(detail.getChange().getId());
 
     if (Status.MERGED == detail.getChange().getStatus()) {
       includedInPanel.setVisible(true);
@@ -355,6 +348,13 @@
     patchSetsBlock.setRegisterKeys(true);
   }
 
+  private static void discardDiffBaseIfNotApplicable(final Change.Id toShow) {
+    if (currentChangeId != null && !currentChangeId.equals(toShow)) {
+      diffBaseId = null;
+    }
+    currentChangeId = toShow;
+  }
+
   private void addComments(final ChangeDetail detail) {
     comments.clear();