Skip to content

Commit

Permalink
Fix for export api request for campaign subscriber activity and no ac…
Browse files Browse the repository at this point in the history
…tivity returned. In this case 'data.split' will fail as data is undefined.
  • Loading branch information
cbrady321 committed Dec 19, 2012
1 parent 2916dff commit e53ae4b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/mailchimp/MailChimpExportAPI_v1_0.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,13 @@ MailChimpExportAPI_v1_0.prototype.campaignSubscriberActivity = function (params,
* it to the callback function.
*/
MailChimpExportAPI_v1_0.prototype.campaignSubscriberActivityProcess = function (data, callback) {


// when api returns empty set data variable is undefined
if(typeof data === 'undefined'){
callback(null, []);
return;
}

var resultStrings = data.split("\n");
var resultJSON = [];

Expand Down

0 comments on commit e53ae4b

Please sign in to comment.