From b31c8da7ae218e3d6fb6f03f4ae210a1b0948bef Mon Sep 17 00:00:00 2001 From: Malte Rosenbjerg Date: Thu, 5 Oct 2023 08:58:50 +0200 Subject: [PATCH] Fix tags container null ref exception --- FFMpegCore/FFProbe/FFProbeAnalysis.cs | 6 +++--- FFMpegCore/FFProbe/MediaFormat.cs | 2 +- FFMpegCore/FFProbe/MediaStream.cs | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/FFMpegCore/FFProbe/FFProbeAnalysis.cs b/FFMpegCore/FFProbe/FFProbeAnalysis.cs index b053d98..0b32da7 100644 --- a/FFMpegCore/FFProbe/FFProbeAnalysis.cs +++ b/FFMpegCore/FFProbe/FFProbeAnalysis.cs @@ -87,7 +87,7 @@ public class FFProbeStream : ITagsContainer, IDispositionContainer public Dictionary Disposition { get; set; } = null!; [JsonPropertyName("tags")] - public Dictionary Tags { get; set; } = null!; + public Dictionary? Tags { get; set; } [JsonPropertyName("side_data_list")] public List> SideData { get; set; } = null!; @@ -126,7 +126,7 @@ public class Format : ITagsContainer public int ProbeScore { get; set; } [JsonPropertyName("tags")] - public Dictionary Tags { get; set; } = null!; + public Dictionary? Tags { get; set; } } public interface IDispositionContainer @@ -136,7 +136,7 @@ public interface IDispositionContainer public interface ITagsContainer { - Dictionary Tags { get; set; } + Dictionary? Tags { get; set; } } public static class TagExtensions diff --git a/FFMpegCore/FFProbe/MediaFormat.cs b/FFMpegCore/FFProbe/MediaFormat.cs index c588165..7269a95 100644 --- a/FFMpegCore/FFProbe/MediaFormat.cs +++ b/FFMpegCore/FFProbe/MediaFormat.cs @@ -1,6 +1,6 @@ namespace FFMpegCore { - public class MediaFormat + public class MediaFormat : ITagsContainer { public TimeSpan Duration { get; set; } public TimeSpan StartTime { get; set; } diff --git a/FFMpegCore/FFProbe/MediaStream.cs b/FFMpegCore/FFProbe/MediaStream.cs index 008390e..48d1f38 100644 --- a/FFMpegCore/FFProbe/MediaStream.cs +++ b/FFMpegCore/FFProbe/MediaStream.cs @@ -2,7 +2,7 @@ namespace FFMpegCore { - public abstract class MediaStream + public abstract class MediaStream : ITagsContainer { public int Index { get; set; } public string CodecName { get; set; } = null!;