report(table): handle null cells (#5075)

This commit is contained in:
Patrick Hulce 2018-04-30 17:08:24 -07:00 коммит произвёл Paul Irish
Родитель 21b100fbdb
Коммит 25f920e09d
3 изменённых файлов: 5 добавлений и 3 удалений

Просмотреть файл

@ -137,7 +137,8 @@ class UnminifiedCSS extends ByteEfficiencyAudit {
// If the ratio is minimal, the file is likely already minified, so ignore it.
// If the total number of bytes to be saved is quite small, it's also safe to ignore.
if (result.wastedPercent < IGNORE_THRESHOLD_IN_PERCENT ||
result.wastedBytes < IGNORE_THRESHOLD_IN_BYTES) continue;
result.wastedBytes < IGNORE_THRESHOLD_IN_BYTES ||
!Number.isFinite(result.wastedBytes)) continue;
results.push(result);
}

Просмотреть файл

@ -84,7 +84,8 @@ class UnminifiedJavaScript extends ByteEfficiencyAudit {
// If the ratio is minimal, the file is likely already minified, so ignore it.
// If the total number of bytes to be saved is quite small, it's also safe to ignore.
if (result.wastedPercent < IGNORE_THRESHOLD_IN_PERCENT ||
result.wastedBytes < IGNORE_THRESHOLD_IN_BYTES) continue;
result.wastedBytes < IGNORE_THRESHOLD_IN_BYTES ||
!Number.isFinite(result.wastedBytes)) continue;
results.push(result);
} catch (err) {
debugString = `Unable to process ${networkRecord._url}: ${err.message}`;

Просмотреть файл

@ -203,7 +203,7 @@ class DetailsRenderer {
for (const heading of details.headings) {
const value = /** @type {number|string|!DetailsRenderer.DetailsJSON} */ (row[heading.key]);
if (typeof value === 'undefined') {
if (typeof value === 'undefined' || value === null) {
this._dom.createChildOf(rowElem, 'td', 'lh-table-column--empty');
continue;
}