CodeByZach / pace

Automatically add a progress bar to your site.
https://codebyzach.github.io/pace/
MIT License
15.68k stars 1.9k forks source link

Uncaught TypeError: Array.prototype.indexOf called on null or undefined #501

Closed SAGEof6iixPATHS closed 4 years ago

SAGEof6iixPATHS commented 4 years ago

Why am I getting this error? Error from the chrome's console... Uncaught TypeError: Array.prototype.indexOf called on null or undefined at indexOf (<anonymous>) at Function.c.inArray (zepto.js:2) at HTMLDivElement.<anonymous> (index.html:97) at HTMLDivElement.j (zepto.js:2) c.inArray @ zepto.js:2 (anonymous) @ index.html:97 j @ zepto.js:2

And this is the code on and after the 97th line.

if ($.inArray($("#recipient-email").val(), recipientList) == -1) { recipientList.push($("#recipient-email").val()); localStorage.setItem( "recipient-list", JSON.stringify(recipientList) );