Skip to content

Commit

Permalink
handled error if rudderanalytics is not initialized in script
Browse files Browse the repository at this point in the history
  • Loading branch information
prabrishac committed Jul 20, 2020
1 parent a9e2a2a commit ddb853e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion analytics.js
Original file line number Diff line number Diff line change
Expand Up @@ -944,7 +944,7 @@ let argumentsArray = window.rudderanalytics;
while(argumentsArray && argumentsArray[0] && argumentsArray[0][0] !== "load"){
argumentsArray.shift();
}
if(argumentsArray.length > 0 && argumentsArray[0][0] === "load"){
if(argumentsArray && argumentsArray.length > 0 && argumentsArray[0][0] === "load"){
const method = argumentsArray[0][0];
argumentsArray[0].shift();
logger.debug("=====from init, calling method:: ", method);
Expand Down

0 comments on commit ddb853e

Please sign in to comment.