diff --git a/NzbDrone.Core/Providers/VideoFileInfoReader.cs b/NzbDrone.Core/Providers/VideoFileInfoReader.cs index 1aa8c121e..beb87c79c 100644 --- a/NzbDrone.Core/Providers/VideoFileInfoReader.cs +++ b/NzbDrone.Core/Providers/VideoFileInfoReader.cs @@ -112,10 +112,10 @@ public MediaInfoModel GetMediaInfo(string filename) public TimeSpan GetRunTime(string filename) { - var mediaInfo = new MediaInfo(); - + MediaInfo mediaInfo = null; try { + mediaInfo = new MediaInfo(); _logger.Trace("Getting media info from {0}", filename); mediaInfo.Option("ParseSpeed", "0.2"); @@ -133,7 +133,13 @@ public TimeSpan GetRunTime(string filename) catch (Exception ex) { _logger.ErrorException("Unable to parse media info from file: " + filename, ex); - mediaInfo.Close(); + } + finally + { + if (mediaInfo != null) + { + mediaInfo.Close(); + } } return new TimeSpan();