diff --git a/public/app/features/explore/QueryEditor.tsx b/public/app/features/explore/QueryEditor.tsx index 2f689409179..de8706b0a21 100644 --- a/public/app/features/explore/QueryEditor.tsx +++ b/public/app/features/explore/QueryEditor.tsx @@ -73,7 +73,7 @@ export default class QueryEditor extends PureComponent { const hasNewError = prevProps.error !== this.props.error; if (this.component) { - if (hasToggledEditorMode) { + if (hasToggledEditorMode && this.angularScope && this.angularScope.toggleEditorMode) { this.angularScope.toggleEditorMode(); }