From 707e9e85c379f2880bb0e6610ebd7322a7d3bcfc Mon Sep 17 00:00:00 2001 From: Jay Date: Fri, 4 Oct 2024 07:44:11 +0200 Subject: [PATCH] fix: handle logbook room not found without throwing an error. (#1434) --- src/logbooks/logbooks.service.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/logbooks/logbooks.service.ts b/src/logbooks/logbooks.service.ts index 133c0a784..344596c5a 100644 --- a/src/logbooks/logbooks.service.ts +++ b/src/logbooks/logbooks.service.ts @@ -66,6 +66,11 @@ export class LogbooksService { ), ); + if (!res.data) { + Logger.log("Logbook not found", { name }); + return null; + } + Logger.log("Found logbook " + name, "LogbooksService.findByName"); const { skip, limit, sortField } = JSON.parse(filters); Logger.log(