From 24aa68f0909ef67c16eba007c2a39a67b2ab105c Mon Sep 17 00:00:00 2001 From: kolaente Date: Tue, 19 May 2020 17:22:10 +0200 Subject: [PATCH] Don't return all tasks when a user has no lists --- pkg/models/tasks.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkg/models/tasks.go b/pkg/models/tasks.go index 3671df1174f..91007f22e62 100644 --- a/pkg/models/tasks.go +++ b/pkg/models/tasks.go @@ -163,6 +163,11 @@ func (t *Task) ReadAll(a web.Auth, search string, page int, perPage int) (result func getRawTasksForLists(lists []*List, opts *taskOptions) (tasks []*Task, resultCount int, totalItems int64, err error) { + // If the user does not have any lists, don't try to get any tasks + if len(lists) == 0 { + return nil, 0, 0, nil + } + // Set the default concatinator of filter variables to or if none was provided if opts.filterConcat == "" { opts.filterConcat = filterConcatOr