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:
Shawn O. Pearce
2009-02-13 09:46:07 -08:00
parent fc3037b8e5
commit 6139a6d534

View File

@@ -77,6 +77,8 @@ public class UnifiedDiffTable extends AbstractPatchContentTable {
}
public void display(final List<PatchLine> list) {
initVersions(2);
final StringBuilder nc = new StringBuilder();
for (final PatchLine pLine : list) {
appendLine(nc, pLine);