FIX: don't fail if targetUsernames is not set

This commit is contained in:
Sam 2016-08-29 12:39:00 +10:00
parent 2349ab5a51
commit 653f94975c
1 changed files with 7 additions and 2 deletions

View File

@ -87,8 +87,13 @@ export default Ember.Component.extend({
const composer = this.get('composer');
if (composer.get('privateMessage')) {
const usernames = composer.get('targetUsernames').split(',');
if (usernames.length === 1 && usernames[0] === this.currentUser.get('username')) {
let usernames = composer.get('targetUsernames');
if (usernames) {
usernames = usernames.split(',');
}
if (usernames && usernames.length === 1 && usernames[0] === this.currentUser.get('username')) {
const message = this._yourselfConfirm || composer.store.createRecord('composer-message', {
id: 'yourself_confirm',