Skip to content
Snippets Groups Projects
Commit e8fcb500 authored by Kiran Rao's avatar Kiran Rao
Browse files

Fix automated errors

parent 088fb78f
No related branches found
No related tags found
No related merge requests found
......@@ -9,7 +9,7 @@ Meteor.methods({
const room = RocketChat.models.Rooms.findOneById(rid);
if (room == null) {
if (!room) {
throw new Meteor.Error('error-invalid-room', 'Invalid room', { method: 'joinRoom' });
}
......
......@@ -7,7 +7,7 @@ Meteor.methods({
throw new Meteor.Error('error-invalid-user', 'Invalid user', { method: 'setRealName' });
}
let user = Meteor.user();
const user = Meteor.user();
if (user.name === name) {
return name;
......
......@@ -9,7 +9,7 @@ Meteor.methods({
const user = Meteor.user();
if ((user.username != null) && !RocketChat.settings.get('Accounts_AllowUsernameChange')) {
if (user.username && !RocketChat.settings.get('Accounts_AllowUsernameChange')) {
throw new Meteor.Error('error-not-allowed', 'Not allowed', { method: 'setUsername' });
}
......@@ -42,7 +42,7 @@ Meteor.methods({
throw new Meteor.Error('error-could-not-change-username', 'Could not change username', { method: 'setUsername' });
}
if (user.username == null) {
if (!user.username) {
Meteor.runAsUser(user._id, () => Meteor.call('joinDefaultChannels', joinDefaultChannelsSilenced));
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment