Bug 1297707: Show icons in alert dialogs when text is null. r=felipe
authorStephen A Pohl <spohl.mozilla.bugs@gmail.com>
Thu, 25 Aug 2016 21:26:07 -0400
changeset 311293 a5657c5416cec71c7d589a7d67a2b7ceb2bad635
parent 311292 12d8a0ac1520b68af430616938def5b3ddaf53cb
child 311294 7785b40af14f91910ad30c731212e5bdbb50bb09
push id20395
push userryanvm@gmail.com
push dateFri, 26 Aug 2016 13:37:30 +0000
treeherderfx-team@a65b35c8e5b1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfelipe
bugs1297707
milestone51.0a1
Bug 1297707: Show icons in alert dialogs when text is null. r=felipe
toolkit/components/prompts/src/CommonDialog.jsm
--- a/toolkit/components/prompts/src/CommonDialog.jsm
+++ b/toolkit/components/prompts/src/CommonDialog.jsm
@@ -123,18 +123,21 @@ CommonDialog.prototype = {
             this.ui.button1.hidden = true;
             break;
         }
         // Defaults to a visible "ok" button
         if (this.args.button0Label)
             this.setLabelForNode(this.ui.button0, this.args.button0Label);
 
         // display the main text
-        // Bug 317334 - crop string length as a workaround.
-        let croppedMessage = this.args.text.substr(0, 10000);
+        let croppedMessage = "";
+        if (this.args.text) {
+            // Bug 317334 - crop string length as a workaround.
+            croppedMessage = this.args.text.substr(0, 10000);
+        }
         let infoBody = this.ui.infoBody;
         infoBody.appendChild(infoBody.ownerDocument.createTextNode(croppedMessage));
 
         let label = this.args.checkLabel;
         if (label) {
             // Only show the checkbox if label has a value.
             this.ui.checkboxContainer.hidden = false;
             this.setLabelForNode(this.ui.checkbox, label);