fix js error if no parent1 is available

This commit is contained in:
Sebastian Sdorra
2012-12-04 21:56:19 +01:00
parent 677e822f7b
commit 272fb1ea17

View File

@@ -214,10 +214,18 @@ Sonia.repository.ChangesetViewerGrid = Ext.extend(Ext.grid.GridPanel, {
renderIds: function(value, p, record){ renderIds: function(value, p, record){
var parents = this.getParentIds(value, record); var parents = this.getParentIds(value, record);
var parent1 = null;
var parent2 = null;
if ( parents ){
parent1 = parents[0];
if (parents.length > 1){
parent2 = parents[1];
}
}
return this.idsTemplate.apply({ return this.idsTemplate.apply({
id: this.getChangesetId(value, record), id: this.getChangesetId(value, record),
parent: parents[0], parent: parent1,
parent2: parents[1] parent2: parent2
}); });
}, },