Skip to content

Commit

Permalink
fix: handled crash for empty userCompletedAction
Browse files Browse the repository at this point in the history
  • Loading branch information
ethanneff committed Jan 9, 2017
1 parent bb60a24 commit 40e83e2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions www.es6/branch.js
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,11 @@ Branch.prototype.logout = function() {
* @return (Promise)
*/
Branch.prototype.userCompletedAction = function(action, metaData) {
if (!action) {
return new Promise(function(resolve, reject) {
reject('Please set an event name');
});
}

var args = [ action ];

Expand Down
5 changes: 5 additions & 0 deletions www/branch.js
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,11 @@ Branch.prototype.logout = function () {
* @return (Promise)
*/
Branch.prototype.userCompletedAction = function (action, metaData) {
if (!action) {
return new Promise(function (resolve, reject) {
reject('Please set an event name');
});
}

var args = [action];

Expand Down

0 comments on commit 40e83e2

Please sign in to comment.