diff options
author | Raimund Schlüßler <raimund.schluessler@mailbox.org> | 2022-04-25 23:22:10 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-25 23:22:10 +0300 |
commit | 94dc6d87c091f777098b8f8b55dbb5aeae49642c (patch) | |
tree | 01eb8a77efe4919447f4049b5b24721cd41e9487 /src | |
parent | b014024d787b81174d7f587c49738160f14bf550 (diff) |
Check that taskUri is defined before searching (#1973)
Signed-off-by: Raimund Schlüßler <raimund.schluessler@mailbox.org>
Diffstat (limited to 'src')
-rw-r--r-- | src/views/AppSidebar.vue | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/views/AppSidebar.vue b/src/views/AppSidebar.vue index bd420e68..2cc0f6ff 100644 --- a/src/views/AppSidebar.vue +++ b/src/views/AppSidebar.vue @@ -754,17 +754,20 @@ export default { async loadTask() { if (this.task === undefined || this.task === null) { + // If the taskUri is undefined, we cannot search + const taskUri = this.$route.params.taskId + if (!taskUri) return const calendars = this.calendar ? [this.calendar] : this.calendars for (const calendar of calendars) { this.loading = true try { - const task = await this.getTaskByUri({ calendar, taskUri: this.$route.params.taskId }) + const task = await this.getTaskByUri({ calendar, taskUri }) // If we found the task, we don't need to query the other calendars. if (task) { break } } catch { - console.debug('Task ' + this.$route.params.taskId + ' not found in calendar ' + calendar.displayName + '.') + console.debug('Task ' + taskUri + ' not found in calendar ' + calendar.displayName + '.') } } this.loading = false |