Skip to content

Commit

Permalink
move type check
Browse files Browse the repository at this point in the history
  • Loading branch information
connorjclark committed Dec 12, 2019
1 parent 50eb275 commit 0ee5d5a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lighthouse-core/report/html/renderer/details-renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -331,13 +331,11 @@ class DetailsRenderer {
}

/**
* @param {LH.Audit.Details.TableItem} row
* @param {LH.Audit.Details.Value[]} values
* @param {LH.Audit.Details.OpportunityColumnHeading} heading
* @return {Element?}
*/
_renderSubRows(row, heading) {
const values = row[heading.key];
if (!Array.isArray(values)) return null;
_renderSubRows(values, heading) {
const subRowsElement = this._dom.createElement('div', 'lh-sub-rows');
for (const childValue of values) {
const subRowElement = this._renderTableValue(childValue, heading);
Expand Down Expand Up @@ -388,7 +386,9 @@ class DetailsRenderer {
displayUnit: heading.subRows.displayUnit || heading.displayUnit,
label: '',
};
const subRowsElement = this._renderSubRows(row, subRowsHeading);
const values = row[subRowsHeading.key];
if (!Array.isArray(values)) continue;
const subRowsElement = this._renderSubRows(values, subRowsHeading);
if (subRowsElement) valueFragment.appendChild(subRowsElement);
}

Expand Down

0 comments on commit 0ee5d5a

Please sign in to comment.