From 0c0e5e96c842a0a8c49650402a452bee1f83ffa9 Mon Sep 17 00:00:00 2001 From: sgsinclair Date: Tue, 16 Dec 2014 22:08:14 -0500 Subject: [PATCH] temporary fix for summary problem with no records --- src/main/webapp/app/panel/Summary.js | 30 +++++++++++++++------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/src/main/webapp/app/panel/Summary.js b/src/main/webapp/app/panel/Summary.js index b7964c611..8d46245ab 100644 --- a/src/main/webapp/app/panel/Summary.js +++ b/src/main/webapp/app/panel/Summary.js @@ -334,21 +334,23 @@ Ext.define('Voyant.panel.Summary', { scope: this, callback: function(records, operation, success) { var data = []; - var len = records.length; - records.forEach(function(r, index, array) { - data.push({ - id: r.getId(), - type: r.getTerm(), - val: Ext.util.Format.number(r.get('rawFreq'),'0,000'), - docId: r.get('docId'), - len: len + if (records) { // TODO: why wouldn't we have records here? + var len = records.length; + records.forEach(function(r, index, array) { + data.push({ + id: r.getId(), + type: r.getTerm(), + val: Ext.util.Format.number(r.get('rawFreq'),'0,000'), + docId: r.get('docId'), + len: len + }); }); - }); - Ext.dom.Helper.append(el, this.localize('colon')+new Ext.XTemplate(this.localize('documentType')).apply({types: data})+'.'); - - var nextEl = el.next('li'); - if (nextEl && !nextEl.hasCls('x-hidden')) { - this.showDistinctiveWordsStep(nextEl); + Ext.dom.Helper.append(el, this.localize('colon')+new Ext.XTemplate(this.localize('documentType')).apply({types: data})+'.'); + + var nextEl = el.next('li'); + if (nextEl && !nextEl.hasCls('x-hidden')) { + this.showDistinctiveWordsStep(nextEl); + } } } });