From f353eca83881efb827b028778325fea5413467bf Mon Sep 17 00:00:00 2001 From: Ethan Neff Date: Tue, 7 Mar 2017 09:46:50 -0800 Subject: [PATCH] fix: prevent setUserIdentity crash by wrapping id in a string --- README.md | 2 -- src/branch.js | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/README.md b/README.md index 5c8ae0fb..ddf788da 100644 --- a/README.md +++ b/README.md @@ -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) { diff --git a/src/branch.js b/src/branch.js index d2f7fb6c..163dcd3e 100644 --- a/src/branch.js +++ b/src/branch.js @@ -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')