浏览代码

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.
j8
Leonard Kim 8 年前
父节点
当前提交
0451e7c9e7
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2
    2
      conference.js

+ 2
- 2
conference.js 查看文件

2051
      * @param email {string} the new email
2051
      * @param email {string} the new email
2052
      */
2052
      */
2053
     changeLocalEmail(email = '') {
2053
     changeLocalEmail(email = '') {
2054
-        email = email.trim();
2054
+        email = String(email).trim();
2055
 
2055
 
2056
         if (email === APP.settings.getEmail()) {
2056
         if (email === APP.settings.getEmail()) {
2057
             return;
2057
             return;
2075
      * @param url {string} the new url
2075
      * @param url {string} the new url
2076
      */
2076
      */
2077
     changeLocalAvatarUrl(url = '') {
2077
     changeLocalAvatarUrl(url = '') {
2078
-        url = url.trim();
2078
+        url = String(url).trim();
2079
 
2079
 
2080
         if (url === APP.settings.getAvatarUrl()) {
2080
         if (url === APP.settings.getAvatarUrl()) {
2081
             return;
2081
             return;

正在加载...
取消
保存