diff --git a/src/NzbDrone.Core/ImportLists/ImportListSyncService.cs b/src/NzbDrone.Core/ImportLists/ImportListSyncService.cs index fa7c11b6b..80085e095 100644 --- a/src/NzbDrone.Core/ImportLists/ImportListSyncService.cs +++ b/src/NzbDrone.Core/ImportLists/ImportListSyncService.cs @@ -163,7 +163,7 @@ namespace NzbDrone.Core.ImportLists private void ProcessAlbumReport(ImportListDefinition importList, ImportListItemInfo report, Dictionary listExclusions, List albumsToAdd, List artistsToAdd) { - if (report.AlbumMusicBrainzId == null || report.ArtistMusicBrainzId == null) + if (report.AlbumMusicBrainzId.IsNullOrWhiteSpace() || report.ArtistMusicBrainzId.IsNullOrWhiteSpace()) { return; } @@ -267,7 +267,7 @@ namespace NzbDrone.Core.ImportLists private Artist ProcessArtistReport(ImportListDefinition importList, ImportListItemInfo report, Dictionary listExclusions, List artistsToAdd) { - if (report.ArtistMusicBrainzId == null) + if (report.ArtistMusicBrainzId.IsNullOrWhiteSpace()) { return null; } diff --git a/src/NzbDrone.Core/Music/Repositories/ArtistRepository.cs b/src/NzbDrone.Core/Music/Repositories/ArtistRepository.cs index 214c0bf0a..f38056a36 100644 --- a/src/NzbDrone.Core/Music/Repositories/ArtistRepository.cs +++ b/src/NzbDrone.Core/Music/Repositories/ArtistRepository.cs @@ -47,11 +47,9 @@ namespace NzbDrone.Core.Music public Artist FindById(string foreignArtistId) { - Artist artist; + var artist = Query(Builder().Where(m => m.ForeignArtistId == foreignArtistId)).SingleOrDefault(); - artist = Query(Builder().Where(m => m.ForeignArtistId == foreignArtistId)).SingleOrDefault(); - - if (artist == null) + if (artist == null && foreignArtistId.IsNotNullOrWhiteSpace()) { artist = Query(Builder().Where(x => x.OldForeignArtistIds.Contains(foreignArtistId))).SingleOrDefault(); }