fixes #1065, checks if cmController.getContent is defined (#1071)

This commit is contained in:
Cassie Tarakajian 2019-05-10 18:26:48 -04:00 committed by GitHub
parent d4cdd1b790
commit 18239eb2e0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -145,8 +145,10 @@ class PreviewFrame extends React.Component {
mergeLocalFilesAndEditorActiveFile() {
const files = this.props.files.slice();
if (this.props.cmController.getContent) {
const activeFileInEditor = this.props.cmController.getContent();
files.find(file => file.id === activeFileInEditor.id).content = activeFileInEditor.content;
}
return files;
}