Protect code of migration 63

Closes #4537
pull/4609/head
Rodrigo Nascimento 9 years ago
parent 61d4d7cc89
commit 5763ac94bc
No known key found for this signature in database
GPG Key ID: 2C85B3AFE75D23F9
  1. 4
      server/startup/migrations/v063.js

@ -4,7 +4,7 @@ RocketChat.Migrations.add({
var forward = RocketChat.models.Settings.findOne({ _id:'Livechat_forward_open_chats' });
var timeout = RocketChat.models.Settings.findOne({ _id:'Livechat_forward_open_chats_timeout' });
if (forward.value) {
if (forward && forward.value) {
RocketChat.models.Settings.upsert({ _id: 'Livechat_agent_leave_action' }, {
$set: {
value: 'forward',
@ -14,7 +14,7 @@ RocketChat.Migrations.add({
});
}
if (timeout.value !== 60) {
if (timeout && timeout.value !== 60) {
RocketChat.models.Settings.upsert({ _id: 'Livechat_agent_leave_action_timeout' }, {
$set: {
value: timeout.value,

Loading…
Cancel
Save