Bug 1377740 - Only set the url when the link exists n?nechen draft
authorSylvestre Ledru <sledru@mozilla.com>
Mon, 24 Jul 2017 08:16:55 +0200
changeset 614117 0ca62573b0d1a96aa40f98e76cdfdd46b7519a7f
parent 614015 5928d905c0bc0b28f5488b236444c7d7991cf8d4
child 616626 6e6e308bfa05eb27c8c4395a9c12b163c5e701ce
push id69924
push userbmo:sledru@mozilla.com
push dateMon, 24 Jul 2017 06:17:57 +0000
bugs1377740
milestone56.0a1
Bug 1377740 - Only set the url when the link exists n?nechen MozReview-Commit-ID: AqChrNYGChw
mobile/android/chrome/content/about.js
--- a/mobile/android/chrome/content/about.js
+++ b/mobile/android/chrome/content/about.js
@@ -49,17 +49,19 @@ function init() {
       {id: "faqURL",          pref: "app.faqURL"},
       {id: "privacyURL",      pref: "app.privacyURL"},
       {id: "creditsURL",      pref: "app.creditsURL"},
     ];
 
     links.forEach(function(link) {
       let url = formatter.formatURLPref(link.pref);
       let element = document.getElementById(link.id);
-      element.setAttribute("href", url);
+      if (element) {
+        element.setAttribute("href", url);
+      }
     });
   } catch (ex) {}
 
 #ifdef MOZ_UPDATER
   function expectUpdateResult() {
     EventDispatcher.instance.registerListener(function listener(event, data, callback) {
       EventDispatcher.instance.unregisterListener(listener, event);
       showUpdateMessage(data.result);