protect against failure

This commit is contained in:
Sam Saffron 2015-04-16 15:22:21 +10:00
parent c2dd9564b3
commit 948f9b357e

View file

@ -220,7 +220,7 @@ export default DiscourseController.extend({
editReason: this.get("editReason") editReason: this.get("editReason")
}).then(function(result) { }).then(function(result) {
if (result.responseJson.action === "enqueued") { if (result.responseJson && result.responseJson.action === "enqueued") {
self.send('postWasEnqueued'); self.send('postWasEnqueued');
self.destroyDraft(); self.destroyDraft();
self.close(); self.close();