Bug 1305008 - Fix exception in set _viewFlags if this.dbView == null. r=mkmelin a=jorgk DONTBUILD
authoralta88 <alta88>
Fri, 23 Sep 2016 11:50:00 +0200
changeset 27488 3095461265ccd0204de271b5ba9a37162df2fe8b
parent 27487 eb97031be855a8c0f955ae95617a556004d062dc
child 27489 56f333e07eb61c7ec1f208be3308782d1d05831d
push id1850
push userclokep@gmail.com
push dateWed, 08 Mar 2017 19:29:12 +0000
treeherdercomm-esr52@028df196b2d9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmkmelin, jorgk
bugs1305008
Bug 1305008 - Fix exception in set _viewFlags if this.dbView == null. r=mkmelin a=jorgk DONTBUILD
mail/base/modules/dbViewWrapper.js
--- a/mail/base/modules/dbViewWrapper.js
+++ b/mail/base/modules/dbViewWrapper.js
@@ -1298,26 +1298,26 @@ DBViewWrapper.prototype = {
    *    to/from grouped included, so set it.
    * - Single-folder threaded/unthreaded can handle a change to/from unthreaded/
    *    threaded, so set it.
    * - Single-folder can _not_ handle a change between grouped and not-grouped,
    *    so re-generate the view. Also it can't handle a change involving
    *    kUnreadOnly or kShowIgnored.
    */
   set _viewFlags(aViewFlags) {
+    if (this._viewUpdateDepth || !this.dbView) {
+      this.__viewFlags = aViewFlags;
+      return;
+    }
+
     // For viewFlag changes, do not make a random selection if there is not
     // actually anything selected; some views do this (looking at xfvf).
     if (this.dbView.selection && this.dbView.selection.count == 0)
       this.dbView.selection.currentIndex = -1;
 
-    if (this._viewUpdateDepth || !this.dbView) {
-      this.__viewFlags = aViewFlags;
-      return;
-    }
-
     let setViewFlags = true;
     let reSort = false;
     let oldFlags = this.dbView.viewFlags;
     let changedFlags = oldFlags ^ aViewFlags;
 
     if (this.isVirtual) {
       if (this.isMultiFolder &&
           (changedFlags & nsMsgViewFlagsType.kThreadedDisplay &&