Added some defensive coding around when we create an artist for #2915

pull/2922/head
tidusjar 6 years ago
parent 6dccea77c2
commit ca010a0282

@ -1,6 +1,7 @@
using System; using System;
using System.Linq; using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
using EnsureThat;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
using Ombi.Api.Lidarr; using Ombi.Api.Lidarr;
using Ombi.Api.Lidarr.Models; using Ombi.Api.Lidarr.Models;
@ -87,6 +88,11 @@ namespace Ombi.Core.Senders
if (artist == null || artist.id <= 0) 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 // Create artist
var newArtist = new ArtistAdd var newArtist = new ArtistAdd
{ {

Loading…
Cancel
Save