From 9a804b5666ad3ff5b3133e7c96bcfdbaa33098cc Mon Sep 17 00:00:00 2001 From: Harvey Kandola Date: Thu, 21 Dec 2017 13:10:05 +0000 Subject: [PATCH] guard against no meta data before trim() --- gui/app/components/section/markdown/type-editor.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gui/app/components/section/markdown/type-editor.js b/gui/app/components/section/markdown/type-editor.js index e2c7fcb2..9bba1edb 100644 --- a/gui/app/components/section/markdown/type-editor.js +++ b/gui/app/components/section/markdown/type-editor.js @@ -32,7 +32,8 @@ export default Component.extend({ init() { this._super(...arguments); - this.set('pageBody', this.get('meta.rawBody').trim()); + let body = (is.not.undefined(this.get('meta'))) ? this.get('meta.rawBody').trim() : ''; + this.set('pageBody', body); }, didInsertElement() {