Explore: Fix Cannot read property 'emit' of null error (#34114)

* Use state.eventBridge for errors only if angular editor (some SQL data sources are still listening on this)

* Update public/app/features/explore/state/query.ts

* Update public/app/features/explore/state/query.ts
This commit is contained in:
Ivana Huckova 2021-05-17 17:48:04 +02:00 committed by GitHub
parent edcefe1c8e
commit 31c1fc3e6e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -660,9 +660,11 @@ export const processQueryResponse = (
return state;
}
// For Angular editors
// Send error to Angular editors
if (state.datasourceInstance?.components?.QueryCtrl) {
state.eventBridge.emit(PanelEvents.dataError, error);
}
}
if (!request) {
return { ...state };
@ -673,7 +675,6 @@ export const processQueryResponse = (
// Send legacy data to Angular editors
if (state.datasourceInstance?.components?.QueryCtrl) {
const legacy = series.map((v) => toLegacyResponseData(v));
state.eventBridge.emit(PanelEvents.dataReceived, legacy);
}