Our website uses cookies to enhance your browsing experience.
Accept
to the top
>
>
>
Examples of errors detected by the...

Examples of errors detected by the V3179 diagnostic

V3179. Calling element access method for potentially empty collection may result in exception.


Radarr

V3179 Calling the 'First' method for potentially empty collection 'languageParse' may result in exception. ManualImportService.cs 107


public ManualImportItem ReprocessItem(string path,
                                      string downloadId,
                                      int movieId,
                                      string releaseGroup)
{
  var rootFolder = Path.GetDirectoryName(path);
  var movie = _movieService.GetMovie(movieId);

  var languageParse = LanguageParser.ParseLanguages(path);

  if (   languageParse.Count <= 1
      && languageParse.First() == Language.Unknown              // <=
      && movie != null)
  {
    ....
  }
  ....
}