diff --git a/libtextsecure/message_receiver.js b/libtextsecure/message_receiver.js index ca192ca5e..e10354443 100644 --- a/libtextsecure/message_receiver.js +++ b/libtextsecure/message_receiver.js @@ -1130,14 +1130,11 @@ MessageReceiver.prototype.extend({ window.storage.put('isSecondaryDevice', true); Whisper.events.trigger('secondaryDeviceRegistration'); // Update profile name - if (dataMessage) { - const { profile } = dataMessage; - if (profile) { - const ourNumber = textsecure.storage.user.getNumber(); - const me = window.ConversationController.get(ourNumber); - if (me) { - me.setLokiProfile(profile); - } + if (dataMessage && dataMessage.profile) { + const ourNumber = textsecure.storage.user.getNumber(); + const me = window.ConversationController.get(ourNumber); + if (me) { + me.setLokiProfile(dataMessage.profile); } } } else {