Bug 1401528 - do not reference non-existent args[1] in fakeserver smtpd.js. r=jcranmer
authoraceman <acelists@atlas.sk>
Mon, 25 Sep 2017 12:29:00 +0200
changeset 29242 c82304da41745162f4d7c0d71b150ca78bbae9d4
parent 29241 4fd348dc8b0c427e538ce1411df0a4b240c8760e
child 29243 5f5b8b76159a35ed3d17ffa2a0b8c72a3419c310
push id2068
push userclokep@gmail.com
push dateMon, 13 Nov 2017 19:02:14 +0000
treeherdercomm-beta@9c7e7ce8672b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjcranmer
bugs1401528
Bug 1401528 - do not reference non-existent args[1] in fakeserver smtpd.js. r=jcranmer
mailnews/test/fakeserver/smtpd.js
--- a/mailnews/test/fakeserver/smtpd.js
+++ b/mailnews/test/fakeserver/smtpd.js
@@ -71,17 +71,17 @@ SMTP_RFC2821_handler.prototype = {
     var scheme = args[0].toUpperCase();
     // |scheme| contained in |kAuthSchemes|?
     if (!this.kAuthSchemes.some(function (s) { return s == scheme; }))
       return "504 AUTH " + scheme + " not supported";
     var func = this._kAuthSchemeStartFunction[scheme];
     if (!func || typeof(func) != "function")
       return "504 I just pretended to implement AUTH " + scheme + ", but I don't";
     dump("Starting AUTH " + scheme + "\n");
-    return func.call(this, args[1]);
+    return func.call(this, ((args.length > 1) ? args[1] : undefined));
   },
   MAIL: function (args) {
     if (this._state == kStateAuthNeeded)
       return "530 5.7.0 Authentication required";
     return "250 ok";
   },
   RCPT: function(args) {
     if (this._state == kStateAuthNeeded)