From ca010a02824229f8e81052be1133a2c2547f3531 Mon Sep 17 00:00:00 2001 From: tidusjar Date: Sun, 7 Apr 2019 00:09:19 +0100 Subject: [PATCH] Added some defensive coding around when we create an artist for #2915 --- src/Ombi.Core/Senders/MusicSender.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Ombi.Core/Senders/MusicSender.cs b/src/Ombi.Core/Senders/MusicSender.cs index 76a9fc14c..0e9db9192 100644 --- a/src/Ombi.Core/Senders/MusicSender.cs +++ b/src/Ombi.Core/Senders/MusicSender.cs @@ -1,6 +1,7 @@ using System; using System.Linq; using System.Threading.Tasks; +using EnsureThat; using Microsoft.Extensions.Logging; using Ombi.Api.Lidarr; using Ombi.Api.Lidarr.Models; @@ -87,6 +88,11 @@ namespace Ombi.Core.Senders if (artist == null || artist.id <= 0) { + EnsureArg.IsNotNullOrEmpty(model.ForeignArtistId, nameof(model.ForeignArtistId)); + EnsureArg.IsNotNullOrEmpty(model.ForeignAlbumId, nameof(model.ForeignAlbumId)); + EnsureArg.IsNotNullOrEmpty(model.ArtistName, nameof(model.ArtistName)); + EnsureArg.IsNotNullOrEmpty(rootFolderPath, nameof(rootFolderPath)); + // Create artist var newArtist = new ArtistAdd {