From 961b52f124cb892ff27f0456fa7ea101f105768d Mon Sep 17 00:00:00 2001 From: emeric Date: Wed, 11 Oct 2023 11:29:37 +0200 Subject: [PATCH] Fixed CodeCL warnings --- src/libs/subsonic/impl/responses/Album.cpp | 3 +-- src/libs/subsonic/impl/responses/Song.cpp | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/libs/subsonic/impl/responses/Album.cpp b/src/libs/subsonic/impl/responses/Album.cpp index 8694f06b..78bfb6c6 100644 --- a/src/libs/subsonic/impl/responses/Album.cpp +++ b/src/libs/subsonic/impl/responses/Album.cpp @@ -121,8 +121,7 @@ namespace API::Subsonic } // Report the first GENRE for this track - ClusterType::pointer clusterType{ ClusterType::find(dbSession, "GENRE") }; - if (clusterType) + if (ClusterType::pointer clusterType{ ClusterType::find(dbSession, "GENRE") }) { auto clusters{ release->getClusterGroups({clusterType}, 1) }; if (!clusters.empty() && !clusters.front().empty()) diff --git a/src/libs/subsonic/impl/responses/Song.cpp b/src/libs/subsonic/impl/responses/Song.cpp index ac4d3246..73eeb5d7 100644 --- a/src/libs/subsonic/impl/responses/Song.cpp +++ b/src/libs/subsonic/impl/responses/Song.cpp @@ -149,8 +149,7 @@ namespace API::Subsonic trackResponse.setAttribute("starred", StringUtils::toISO8601String(dateTime)); // Report the first GENRE for this track - ClusterType::pointer genreClusterType{ ClusterType::find(dbSession, "GENRE") }; - if (genreClusterType) + if (ClusterType::pointer genreClusterType{ ClusterType::find(dbSession, "GENRE") }) { auto clusters{ track->getClusterGroups({genreClusterType}, 1) }; if (!clusters.empty() && !clusters.front().empty())