diff --git a/src/models/explore.ts b/src/models/explore.ts index 810f4940..9ad73fe4 100644 --- a/src/models/explore.ts +++ b/src/models/explore.ts @@ -105,6 +105,10 @@ export class TransactionExploreQuery { } public toExpression(allCategoriesMap: Record, allAccountsMap: Record, allTagsMap: Record): string { + if (!this.conditions || this.conditions.length < 1) { + return ''; + } + const postfixExprTokens = this.getPostfixExprTokens(); const stack: ExpressionNode[] = []; diff --git a/src/views/desktop/insights/tabs/ExploreQueryTab.vue b/src/views/desktop/insights/tabs/ExploreQueryTab.vue index be3bce0d..708df421 100644 --- a/src/views/desktop/insights/tabs/ExploreQueryTab.vue +++ b/src/views/desktop/insights/tabs/ExploreQueryTab.vue @@ -16,6 +16,7 @@ {{ tt('Query') }} {{ `#${queryIndex + 1}` }} @@ -40,7 +41,7 @@ {{ tt('No conditions defined. All transactions will match.') }} -
+
-
+
@@ -592,7 +593,7 @@ function updateTransactionCategories(changed: boolean, selectedCategoryIds?: str function getExpression(queryIndex: number): string { const query = queries.value[queryIndex]; - if (!query) { + if (!query || !query.conditions || query.conditions.length < 1) { return ''; }