Bug 1499860 - fix Gloda attachment filtering, don't access length of 'undefined' in Gloda Category() function. r=darktrojan a=jorgk
authorJorg K <jorgk@jorgk.com>
Thu, 18 Oct 2018 11:36:30 +0200
changeset 33060 9ce6347cab62
parent 33059 df0d79b1cb64
child 33061 1af8d4fa7627
push id386
push userclokep@gmail.com
push dateTue, 23 Oct 2018 00:48:12 +0000
reviewersdarktrojan, jorgk
bugs1499860
Bug 1499860 - fix Gloda attachment filtering, don't access length of 'undefined' in Gloda Category() function. r=darktrojan a=jorgk
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);
     }