Skip to content

Commit aea2e6a

Browse files
Check for email first then userid
1 parent 9579bc1 commit aea2e6a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

swift-sdk/Internal/IterableAPIInternal.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -222,10 +222,10 @@ final class IterableAPIInternal : NSObject, PushTrackerProtocol {
222222
AnyHashable.ITBL_KEY_NEW_EMAIL: newEmail
223223
]
224224

225-
if let userId = userId {
226-
args[AnyHashable.ITBL_KEY_CURRENT_USER_ID] = userId
227-
} else if let email = email {
225+
if let email = email {
228226
args[AnyHashable.ITBL_KEY_CURRENT_EMAIL] = email
227+
} else if let userId = userId {
228+
args[AnyHashable.ITBL_KEY_CURRENT_USER_ID] = userId
229229
} else {
230230
ITBError("Both email and userId are nil")
231231
onFailure?("Both email and userId are nil", nil)

0 commit comments

Comments
 (0)