From aa9e778c8eccdeac0052d289821008e51f7cabf9 Mon Sep 17 00:00:00 2001 From: rthyberg Date: Wed, 26 Aug 2015 12:57:00 -0400 Subject: [PATCH] Bug 1171382 - Add logic to not render empty keyed histograms. r=gfritzsche --- toolkit/content/aboutTelemetry.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/toolkit/content/aboutTelemetry.js b/toolkit/content/aboutTelemetry.js index 63ed376573b0..6c33eb38c8bd 100644 --- a/toolkit/content/aboutTelemetry.js +++ b/toolkit/content/aboutTelemetry.js @@ -1593,14 +1593,17 @@ function displayPingData(ping) { let keyedDiv = document.getElementById("keyed-histograms"); removeAllChildNodes(keyedDiv); + setHasData("keyed-histograms-section", false); let keyedHistograms = payload.keyedHistograms; - hasData = Object.keys(keyedHistograms).length > 0; - setHasData("keyed-histograms-section", hasData); - - if (hasData) { + if (keyedHistograms) { + let hasData = false; for (let [id, keyed] of Iterator(keyedHistograms)) { - KeyedHistogram.render(keyedDiv, id, keyed, {unpacked: true}); + if (Object.keys(keyed).length > 0) { + hasData = true; + KeyedHistogram.render(keyedDiv, id, keyed, {unpacked: true}); + } } + setHasData("keyed-histograms-section", hasData); } // Show addon histogram data