Skip to content

Commit

Permalink
Merge pull request #15 from seatgeek/pz-issue-14300
Browse files Browse the repository at this point in the history
Make callback optional for conversion
  • Loading branch information
PallasKatze committed Feb 3, 2016
2 parents 74bcfc1 + cb933fd commit 65a2835
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion sixpack.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,16 @@
callback = kpi;
kpi = null;
}
if (!(/^[a-z0-9][a-z0-9\-_ ]*$/).test(experiment_name)) {

if (!callback) {
callback = function(err) {
if (err && console && console.error) {
console.error(err);
}
}
}

if (!experiment_name || !(/^[a-z0-9][a-z0-9\-_ ]*$/).test(experiment_name)) {
return callback(new Error("Bad experiment_name"));
}

Expand Down

0 comments on commit 65a2835

Please sign in to comment.