Add null reference checks.

This commit is contained in:
2022-03-17 00:46:26 +00:00
parent f6245f954d
commit b05dc45d09
18 changed files with 528 additions and 441 deletions

View File

@@ -62,8 +62,15 @@ partial class Dump
_dumpLog.WriteLine("Creating sidecar.");
var filters = new FiltersList();
IFilter filter = filters.GetFilter(_outputPath);
var inputPlugin = ImageFormat.Detect(filter) as IMediaImage;
totalChkDuration = 0;
if(ImageFormat.Detect(filter) is not IMediaImage inputPlugin)
{
StoppingErrorMessage?.Invoke("Could not detect image format.");
return;
}
ErrorNumber opened = inputPlugin.Open(filter);
if(opened != ErrorNumber.NoError)