From b1593c018440cad761f6fd527cb12508c205639b Mon Sep 17 00:00:00 2001 From: Joffrey JAFFEUX Date: Tue, 6 Feb 2018 14:48:04 +0100 Subject: [PATCH] FIX: prevents exception when opening new topic on mobile Repro: - Visit https://meta.discourse.org/categories, refresh the page - Navigate to Latest - Click New Topic - Error occurs --- app/assets/javascripts/discourse/mixins/open-composer.js.es6 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/discourse/mixins/open-composer.js.es6 b/app/assets/javascripts/discourse/mixins/open-composer.js.es6 index 2303281b63b..dcb92d14786 100644 --- a/app/assets/javascripts/discourse/mixins/open-composer.js.es6 +++ b/app/assets/javascripts/discourse/mixins/open-composer.js.es6 @@ -7,8 +7,8 @@ export default Ember.Mixin.create({ this.controllerFor('composer').open({ categoryId: controller.get('category.id'), action: Composer.CREATE_TOPIC, - draftKey: controller.get('model.draft_key'), - draftSequence: controller.get('model.draft_sequence') + draftKey: controller.get('model.draft_key') || Composer.CREATE_TOPIC, + draftSequence: controller.get('model.draft_sequence') || 0 }); },