diff --git a/backend/src/main/java/shook/shook/song/application/dto/UnregisteredSongResponse.java b/backend/src/main/java/shook/shook/song/application/dto/UnregisteredSongResponse.java index bc3db2944..20da84abb 100644 --- a/backend/src/main/java/shook/shook/song/application/dto/UnregisteredSongResponse.java +++ b/backend/src/main/java/shook/shook/song/application/dto/UnregisteredSongResponse.java @@ -19,8 +19,7 @@ public class UnregisteredSongResponse { public static UnregisteredSongResponse from( final SearchedSongFromManiaDBApiResponse searchedSongFromManiaDBApiResponse) { - if (searchedSongFromManiaDBApiResponse.getTrackArtists() == null - || searchedSongFromManiaDBApiResponse.getTrackArtists().getArtists() == null) { + if (isEmptyArtists(searchedSongFromManiaDBApiResponse)) { return new UnregisteredSongResponse( searchedSongFromManiaDBApiResponse.getTitle().trim(), EMPTY_SINGER, @@ -37,6 +36,12 @@ public static UnregisteredSongResponse from( ); } + private static boolean isEmptyArtists( + final SearchedSongFromManiaDBApiResponse searchedSongFromManiaDBApiResponse) { + return searchedSongFromManiaDBApiResponse.getTrackArtists() == null + || searchedSongFromManiaDBApiResponse.getTrackArtists().getArtists() == null; + } + private static String collectToString( final SearchedSongFromManiaDBApiResponse searchedSongFromManiaDBApiResponse) { return searchedSongFromManiaDBApiResponse.getTrackArtists().getArtists().stream()