Skip to content

Commit 732c5cc

Browse files
author
spacedragon
committed
[Code] fix the crash when we refresh the blame view
1 parent 8132915 commit 732c5cc

File tree

1 file changed

+4
-2
lines changed
  • x-pack/plugins/code/public/components/editor

1 file changed

+4
-2
lines changed

x-pack/plugins/code/public/components/editor/editor.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,10 @@ export class EditorComponent extends React.Component<IProps> {
8181
revision: routeRevision,
8282
path: routePath,
8383
} = this.props.match.params;
84-
if (file.content && prevProps.file.content !== file.content) {
85-
this.loadText(file.content, uri, path, file.lang!, revision).then(() => {
84+
const prevContent = prevProps.file && prevProps.file.content;
85+
86+
if (prevContent !== file.content) {
87+
this.loadText(file.content!, uri, path, file.lang!, revision).then(() => {
8688
if (this.props.revealPosition) {
8789
this.revealPosition(this.props.revealPosition);
8890
}

0 commit comments

Comments
 (0)