From 18239eb2e02fe26455a3d1529f77049f7fcf5e85 Mon Sep 17 00:00:00 2001 From: Cassie Tarakajian Date: Fri, 10 May 2019 18:26:48 -0400 Subject: [PATCH] fixes #1065, checks if cmController.getContent is defined (#1071) --- client/modules/IDE/components/PreviewFrame.jsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/client/modules/IDE/components/PreviewFrame.jsx b/client/modules/IDE/components/PreviewFrame.jsx index 8bae9b4c..21ede62a 100644 --- a/client/modules/IDE/components/PreviewFrame.jsx +++ b/client/modules/IDE/components/PreviewFrame.jsx @@ -145,8 +145,10 @@ class PreviewFrame extends React.Component { mergeLocalFilesAndEditorActiveFile() { const files = this.props.files.slice(); - const activeFileInEditor = this.props.cmController.getContent(); - files.find(file => file.id === activeFileInEditor.id).content = activeFileInEditor.content; + if (this.props.cmController.getContent) { + const activeFileInEditor = this.props.cmController.getContent(); + files.find(file => file.id === activeFileInEditor.id).content = activeFileInEditor.content; + } return files; }