Fixed: (Cardigann) Use GetValueOrDefault to prevent InvalidOperation

pull/1485/head
Bogdan 2 years ago
parent 8323d13a1d
commit fa4534dcff

@ -538,27 +538,27 @@ namespace NzbDrone.Core.Indexers.Cardigann
break; break;
case "imdb": case "imdb":
case "imdbid": case "imdbid":
release.ImdbId = (int)ParseUtil.GetLongFromString(value); release.ImdbId = (int)ParseUtil.GetLongFromString(value).GetValueOrDefault();
value = release.ImdbId.ToString(); value = release.ImdbId.ToString();
break; break;
case "tmdbid": case "tmdbid":
release.TmdbId = (int)ParseUtil.GetLongFromString(value); release.TmdbId = (int)ParseUtil.GetLongFromString(value).GetValueOrDefault();
value = release.TmdbId.ToString(); value = release.TmdbId.ToString();
break; break;
case "rageid": case "rageid":
release.TvRageId = (int)ParseUtil.GetLongFromString(value); release.TvRageId = (int)ParseUtil.GetLongFromString(value).GetValueOrDefault();
value = release.TvRageId.ToString(); value = release.TvRageId.ToString();
break; break;
case "traktid": case "traktid":
release.TraktId = (int)ParseUtil.GetLongFromString(value); release.TraktId = (int)ParseUtil.GetLongFromString(value).GetValueOrDefault();
value = release.TraktId.ToString(); value = release.TraktId.ToString();
break; break;
case "tvdbid": case "tvdbid":
release.TvdbId = (int)ParseUtil.GetLongFromString(value); release.TvdbId = (int)ParseUtil.GetLongFromString(value).GetValueOrDefault();
value = release.TvdbId.ToString(); value = release.TvdbId.ToString();
break; break;
case "doubanid": case "doubanid":
release.DoubanId = (int)ParseUtil.GetLongFromString(value); release.DoubanId = (int)ParseUtil.GetLongFromString(value).GetValueOrDefault();
value = release.DoubanId.ToString(); value = release.DoubanId.ToString();
break; break;
case "poster": case "poster":

Loading…
Cancel
Save