Bug 1314347 - Crash in InvalidArrayIndex_CRASH | nsMsgDBView::GetCommandStatus (analysis by alta88). r=rkent DONTBUILD
authorJorg K <jorgk@jorgk.com>
Sat, 15 Oct 2016 14:09:39 -0400
changeset 20688 228b399d8933abaa10c96f7616f5f98fb452821e
parent 20687 b10948d0a008d21ccf941acc2bca0f44973294fd
child 20689 666da1b1fc5721d00a996c1b52d864f649fa2fd6
push id12518
push usermozilla@jorgk.com
push dateFri, 11 Nov 2016 18:49:06 +0000
treeherdercomm-central@228b399d8933 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersrkent
bugs1314347
Bug 1314347 - Crash in InvalidArrayIndex_CRASH | nsMsgDBView::GetCommandStatus (analysis by alta88). r=rkent DONTBUILD
mailnews/base/src/nsMsgDBView.cpp
--- a/mailnews/base/src/nsMsgDBView.cpp
+++ b/mailnews/base/src/nsMsgDBView.cpp
@@ -2759,17 +2759,17 @@ NS_IMETHODIMP nsMsgDBView::GetCommandSta
   case nsMsgViewCommandType::unflagMessages:
   case nsMsgViewCommandType::toggleThreadWatched:
   case nsMsgViewCommandType::markThreadRead:
   case nsMsgViewCommandType::downloadSelectedForOffline:
     *selectable_p = haveSelection;
     break;
   case nsMsgViewCommandType::junk:
   case nsMsgViewCommandType::unjunk:
-    *selectable_p = haveSelection && JunkControlsEnabled(selection[0]);
+    *selectable_p = haveSelection && numIndices && JunkControlsEnabled(selection[0]);
     break;
   case nsMsgViewCommandType::cmdRequiringMsgBody:
     *selectable_p = haveSelection && (!WeAreOffline() || OfflineMsgSelected(indices, numIndices));
     break;
   case nsMsgViewCommandType::downloadFlaggedForOffline:
   case nsMsgViewCommandType::markAllRead:
     *selectable_p = true;
     break;