Skip to content

Commit

Permalink
fix: prevent setUserIdentity crash by wrapping id in a string
Browse files Browse the repository at this point in the history
  • Loading branch information
ethanneff committed Mar 7, 2017
1 parent 4521221 commit f353eca
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -452,8 +452,6 @@

- Sets the identity of a user (email, ID, UUID, etc) for events, deep links, and referrals

- Must be a `string`

```js
var userId = '123456'
Branch.setIdentity(userId).then(function (res) {
Expand Down
2 changes: 1 addition & 1 deletion src/branch.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ Branch.prototype.getLatestReferringParams = function () {

Branch.prototype.setIdentity = function (identity) {
if (identity) {
return execute('setIdentity', [identity])
return execute('setIdentity', [String(identity)])
} else {
return new Promise(function (resolve, reject) {
reject('Please set an identity')
Expand Down

0 comments on commit f353eca

Please sign in to comment.