Bug 678244 - Fix minor coding errors in patch from bug 602718 r=bienvenu a=standard8
authorJonathan Kamens <jik@kamens.brookline.ma.us>
Thu, 25 Aug 2011 11:07:55 -0700
changeset 8778 ba1eb5fe355ba4f3244e13f2213818febb8898d4
parent 8777 4d2fab5dcade3dc58da3820fd436250b4607331f
child 8779 7ad5d6eb752754785bd410fb3ad3710d2281be69
push id158
push userbugzilla@standard8.plus.com
push dateTue, 27 Sep 2011 19:18:14 +0000
treeherdercomm-beta@e47b99c61e4d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbienvenu, standard8
bugs678244, 602718
Bug 678244 - Fix minor coding errors in patch from bug 602718 r=bienvenu a=standard8
mail/base/content/mailWindowOverlay.js
--- a/mail/base/content/mailWindowOverlay.js
+++ b/mail/base/content/mailWindowOverlay.js
@@ -474,32 +474,33 @@ function InitViewBodyMenu()
   catch (ex)
   {
     dump("failed to get the body plaintext vs. HTML prefs\n");
   }
 
   var AllowHTML_menuitem = document.getElementById(menuIDs[0]);
   var Sanitized_menuitem = document.getElementById(menuIDs[1]);
   var AsPlaintext_menuitem = document.getElementById(menuIDs[2]);
-  var AllBodyParts_menuitem = document.getElementById(menuIDs[3]);
+  var AllBodyParts_menuitem = menuIDs[3] ? document.getElementById(menuIDs[3])
+        : null;
 
   document.getElementById("bodyAllParts").hidden = 
     ! pref.getBoolPref("mailnews.display.show_all_body_parts_menu");
       
   if (!prefer_plaintext && !html_as && !disallow_classes &&
       AllowHTML_menuitem)
     AllowHTML_menuitem.setAttribute("checked", true);
   else if (!prefer_plaintext && html_as == 3 && disallow_classes > 0 &&
       Sanitized_menuitem)
     Sanitized_menuitem.setAttribute("checked", true);
   else if (prefer_plaintext && html_as == 1 && disallow_classes > 0 &&
       AsPlaintext_menuitem)
     AsPlaintext_menuitem.setAttribute("checked", true);
   else if (!prefer_plaintext && html_as == 4 && !disallow_classes &&
-      AllowHTML_menuitem)
+      AllBodyParts_menuitem)
     AllBodyParts_menuitem.setAttribute("checked", true);
   // else (the user edited prefs/user.js) check none of the radio menu items
 
   if (isFeed) {
     AllowHTML_menuitem.hidden = !gShowFeedSummary;
     Sanitized_menuitem.hidden = !gShowFeedSummary;
     AsPlaintext_menuitem.hidden = !gShowFeedSummary;
     document.getElementById("viewFeedSummarySeparator").hidden = !gShowFeedSummary;