Fix refreshing PatchScreen when fileList has not yet been loaded
Although PatchScreen and PatchTable typically guard against using a not yet loaded PatchTable, refreshing a PatchScreen and the subsequent moving of the pointer lacked such guards. Thereby, a race condition was introduced that lead to issue 1749. We now added guards in both PatchScreen, and PatchTable. Bug: issue 1749 Change-Id: I03ee3e80c198373ebecc50b1135b9c542d8ecfe7 (cherry picked from commit da5ceb4c9c73306b90be4349a4e7e106ab78e676)
This commit is contained in:

committed by
Shawn Pearce

parent
8ea0c8b12b
commit
0d1ba95185
@@ -159,8 +159,10 @@ public class PatchTable extends Composite {
|
||||
}
|
||||
|
||||
public void movePointerTo(final Patch.Key k) {
|
||||
if (myTable != null) {
|
||||
myTable.movePointerTo(k);
|
||||
}
|
||||
}
|
||||
|
||||
public void setActive(boolean active) {
|
||||
this.active = active;
|
||||
|
@@ -361,7 +361,7 @@ public abstract class PatchScreen extends Screen implements
|
||||
lastScript = null;
|
||||
settingsPanel.setEnabled(false);
|
||||
reviewedPanels.populate(patchKey, fileList, patchIndex, getPatchScreenType());
|
||||
if (isFirst && fileList != null) {
|
||||
if (isFirst && fileList != null && fileList.isLoaded()) {
|
||||
fileList.movePointerTo(patchKey);
|
||||
}
|
||||
PatchUtil.DETAIL_SVC.patchScript(patchKey, idSideA, idSideB, //
|
||||
|
Reference in New Issue
Block a user