Skip to content

Commit

Permalink
fix(dashboard): text widget crashed dashboard when resource explorer …
Browse files Browse the repository at this point in the history
…is open
  • Loading branch information
ssjagad authored and tracy-french committed Sep 29, 2023
1 parent 51933bc commit 337bcaf
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/dashboard/src/components/queryEditor/useQuery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,10 @@ export function useQuery(): [Query | undefined, (cb: (currentQuery?: Query) => Q
const selectedWidgets = useSelectedWidgets<QueryProperty>();
const selectedWidget = isOneWidgetSelected(selectedWidgets) ? getFirstWidget(selectedWidgets) : undefined;

const query = isWidget(selectedWidget) ? getQueryFromWidget(selectedWidget) : undefined;
const query =
isWidget(selectedWidget) && 'queryConfig' in selectedWidget.properties
? getQueryFromWidget(selectedWidget)
: undefined;

function setQuery(cb: (currentQuery?: Query) => Query | undefined): void {
// Only update the query if a widget is selected
Expand Down

0 comments on commit 337bcaf

Please sign in to comment.