From c07f33f5ade517fed808564576d3edd3c7289242 Mon Sep 17 00:00:00 2001 From: Kevin Ansfield Date: Wed, 19 Aug 2015 19:59:59 +0100 Subject: [PATCH] guard against missing $previewContent/ViewPort in gh-editor.scrollPosition issue #5659 - fixes occasional issue with editor not rendering due to scrollPosition being requested before the relevant jquery elements have been set --- core/client/app/components/gh-editor.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/client/app/components/gh-editor.js b/core/client/app/components/gh-editor.js index abe1845cb2..4172024c4f 100644 --- a/core/client/app/components/gh-editor.js +++ b/core/client/app/components/gh-editor.js @@ -41,7 +41,7 @@ export default Ember.Component.extend({ // scrollPosition value such that when either scrolling or typing-at-the-end of the text editor the preview pane // stays in sync scrollPosition: Ember.computed('editorScrollInfo', 'height', function () { - if (!this.get('editorScrollInfo')) { + if (!this.get('editorScrollInfo') || !this.get('$previewContent') || !this.get('$previewViewPort')) { return 0; }