diff --git a/frontend/src/metabase-lib/Question.ts b/frontend/src/metabase-lib/Question.ts index ff183471ca5fc3f4ad348875b82e24a8bb1989b5..565cdfaf7b9d2925f87140706b89c6669b09440c 100644 --- a/frontend/src/metabase-lib/Question.ts +++ b/frontend/src/metabase-lib/Question.ts @@ -194,7 +194,7 @@ class QuestionInner { } } - throw new Error("Unknown query type: " + datasetQuery.type); + console.warn("Unknown query type: " + datasetQuery?.type); } isNative(): boolean { diff --git a/frontend/src/metabase-lib/queries/InternalQuery.ts b/frontend/src/metabase-lib/queries/InternalQuery.ts index 26a6ae71bba095a3164a705942cf6424f76029e4..f2c2928680ae6920712761b86b2d48efba6c95a1 100644 --- a/frontend/src/metabase-lib/queries/InternalQuery.ts +++ b/frontend/src/metabase-lib/queries/InternalQuery.ts @@ -11,6 +11,6 @@ import AtomicQuery from "metabase-lib/queries/AtomicQuery"; // Internal queries export default class InternalQuery extends AtomicQuery { static isDatasetQueryType(datasetQuery: DatasetQuery) { - return datasetQuery.type === "internal"; + return datasetQuery?.type === "internal"; } } diff --git a/frontend/src/metabase-lib/queries/NativeQuery.ts b/frontend/src/metabase-lib/queries/NativeQuery.ts index 5767f551c57ace4c7c972b083e31eb99919d5bb7..ac51aec4871e00e5c59277f9420ab5dc6c48027a 100644 --- a/frontend/src/metabase-lib/queries/NativeQuery.ts +++ b/frontend/src/metabase-lib/queries/NativeQuery.ts @@ -137,7 +137,7 @@ export default class NativeQuery extends AtomicQuery { } static isDatasetQueryType(datasetQuery: DatasetQuery) { - return datasetQuery && datasetQuery.type === NATIVE_QUERY_TEMPLATE.type; + return datasetQuery?.type === NATIVE_QUERY_TEMPLATE.type; } /* Query superclass methods */ diff --git a/frontend/src/metabase-lib/queries/StructuredQuery.ts b/frontend/src/metabase-lib/queries/StructuredQuery.ts index bb4b97b7e7650c304876ccd2686649a558d39b98..f11c638f80c38700a225c5d39281921d0c5e234d 100644 --- a/frontend/src/metabase-lib/queries/StructuredQuery.ts +++ b/frontend/src/metabase-lib/queries/StructuredQuery.ts @@ -99,7 +99,7 @@ export interface SegmentOption { class StructuredQueryInner extends AtomicQuery { static isDatasetQueryType(datasetQuery: DatasetQuery) { - return datasetQuery && datasetQuery.type === STRUCTURED_QUERY_TEMPLATE.type; + return datasetQuery?.type === STRUCTURED_QUERY_TEMPLATE.type; } // For Flow type completion