From b50fc351a12fa890b2d4ab6e71b7a4b609dd583c Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Thu, 2 Jan 2014 16:21:47 -0500 Subject: add null checks to video methods --- .../Resolvers/EntityResolutionHelper.cs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'MediaBrowser.Controller/Resolvers/EntityResolutionHelper.cs') diff --git a/MediaBrowser.Controller/Resolvers/EntityResolutionHelper.cs b/MediaBrowser.Controller/Resolvers/EntityResolutionHelper.cs index 3cd38da45..079571ee9 100644 --- a/MediaBrowser.Controller/Resolvers/EntityResolutionHelper.cs +++ b/MediaBrowser.Controller/Resolvers/EntityResolutionHelper.cs @@ -66,6 +66,11 @@ namespace MediaBrowser.Controller.Resolvers /// true if [is multi part file] [the specified path]; otherwise, false. public static bool IsMultiPartFile(string path) { + if (string.IsNullOrEmpty(path)) + { + throw new ArgumentNullException("path"); + } + return MultiFileRegex.Match(path).Success || MultiFolderRegex.Match(path).Success; } @@ -97,6 +102,11 @@ namespace MediaBrowser.Controller.Resolvers /// true if [is audio file] [the specified args]; otherwise, false. public static bool IsAudioFile(string path) { + if (string.IsNullOrEmpty(path)) + { + throw new ArgumentNullException("path"); + } + var extension = Path.GetExtension(path); if (string.IsNullOrEmpty(extension)) @@ -114,6 +124,11 @@ namespace MediaBrowser.Controller.Resolvers /// true if [is video file] [the specified path]; otherwise, false. public static bool IsVideoFile(string path) { + if (string.IsNullOrEmpty(path)) + { + throw new ArgumentNullException("path"); + } + var extension = Path.GetExtension(path); if (string.IsNullOrEmpty(extension)) -- cgit v1.2.3