Don't try to match a null codec name (#784)

* Don't try to match a null codec name

* Add test
This commit is contained in:
ta264
2019-05-01 06:42:01 +01:00
committed by GitHub
parent 1955cd9f73
commit 541841d7b7
2 changed files with 11 additions and 0 deletions
@@ -154,6 +154,11 @@ namespace NzbDrone.Core.Parser
public static Codec ParseCodec(string name, string origName)
{
if (name.IsNullOrWhiteSpace())
{
return Codec.Unknown;
}
var match = CodecRegex.Match(name);
if (!match.Success) { return Codec.Unknown; }