Fix NPE in unified diff view when creating a comment editor
We failed to initialize the versions table, so comment editor creation in the unified diff view of a file always failed with a null pointer exception. In a unified diff view we currently assume there are only two file versions (base, patch set). Signed-off-by: Shawn O. Pearce <sop@google.com>
This commit is contained in:
@@ -77,6 +77,8 @@ public class UnifiedDiffTable extends AbstractPatchContentTable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void display(final List<PatchLine> list) {
|
public void display(final List<PatchLine> list) {
|
||||||
|
initVersions(2);
|
||||||
|
|
||||||
final StringBuilder nc = new StringBuilder();
|
final StringBuilder nc = new StringBuilder();
|
||||||
for (final PatchLine pLine : list) {
|
for (final PatchLine pLine : list) {
|
||||||
appendLine(nc, pLine);
|
appendLine(nc, pLine);
|
||||||
|
|||||||
Reference in New Issue
Block a user