Bug 361: check that trim function exists 54/5554/1
authorLaurence Maultsby <laurence.maultsby@riftio.com>
Tue, 10 Oct 2017 15:37:15 +0000 (11:37 -0400)
committerLaurence Maultsby <laurence.maultsby@riftio.com>
Tue, 10 Oct 2017 15:37:15 +0000 (11:37 -0400)
Signed-off-by: Laurence Maultsby <laurence.maultsby@riftio.com>
skyquake/plugins/accounts/src/account/accountSource.js

index 6ab9a3d..854a5eb 100644 (file)
@@ -175,7 +175,7 @@ module.exports = function(Alt) {
             var payloadKeys = Object.keys(payload[payload['account-type']]);
             var accountData = payload[payload['account-type']];
             payloadKeys.map(function(k) {
-              if (!accountData[k] || accountData[k].trim() == '') {
+              if (!accountData[k] || (accountData[k].trim && accountData[k].trim() == '')) {
                 delete payload[payload['account-type']][k];
               }
             });