From 0451e7c9e70951a02e31ef9175a7454c703151aa Mon Sep 17 00:00:00 2001 From: Leonard Kim Date: Thu, 1 Jun 2017 10:55:44 -0700 Subject: [PATCH] fix(conference): ensure avatar url and email changes act on strings Both conference.changeLocalEmail and conference.changeLocalAvatarUrl are exposed in the external api. It is possible for users to then pass in non-string values. To make it more visibly obvious of the error and to prevent script errors, convert whatever is passed in into a string. --- conference.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/conference.js b/conference.js index c70914ebb..91d7eeb4d 100644 --- a/conference.js +++ b/conference.js @@ -2051,7 +2051,7 @@ export default { * @param email {string} the new email */ changeLocalEmail(email = '') { - email = email.trim(); + email = String(email).trim(); if (email === APP.settings.getEmail()) { return; @@ -2075,7 +2075,7 @@ export default { * @param url {string} the new url */ changeLocalAvatarUrl(url = '') { - url = url.trim(); + url = String(url).trim(); if (url === APP.settings.getAvatarUrl()) { return;