Bug 1499860 - fix Gloda attachment filtering, don't access length of 'undefined' in Gloda Category() function. r=darktrojan DONTBUILD
authorJorg K <jorgk@jorgk.com>
Thu, 18 Oct 2018 11:36:30 +0200
changeset 33399 6c017363106fef577c07e7af3890c0abf21c8657
parent 33398 855ce13ec8f908a335e6583f0cb110311a75c26a
child 33400 8b1c8d483a620c9ad48294fb662d9ff657b07ffd
push id387
push userclokep@gmail.com
push dateMon, 10 Dec 2018 21:30:47 +0000
reviewersdarktrojan
bugs1499860
Bug 1499860 - fix Gloda attachment filtering, don't access length of 'undefined' in Gloda Category() function. r=darktrojan DONTBUILD
mailnews/db/gloda/modules/noun_mimetype.js
--- a/mailnews/db/gloda/modules/noun_mimetype.js
+++ b/mailnews/db/gloda/modules/noun_mimetype.js
@@ -313,17 +313,17 @@ var MimeTypeNoun = {
      *
      * @param aAttrDef The attribute that is using us.
      * @param aArguments The actual arguments object that
      */
     Category: function(aAttrDef, aArguments) {
       let rangePairs = [];
       // If there are no arguments then we want to fall back to the 'in'
       //  constraint which matches on any attachment.
-      if (aArguments.length == 0)
+      if (!aArguments || aArguments.length == 0)
         return this._inConstraintHelper(aAttrDef, []);
 
       for (let iArg = 0; iArg < aArguments.length; iArg++) {
         let arg = aArguments[iArg];
         rangePairs.push(MimeTypeNoun._mimeTypeRangeDummyObjects[arg.category]);
       }
       return this._rangedConstraintHelper(aAttrDef, rangePairs);
     }