diff --git a/src/ImageSharp/Formats/Tiff/TiffFrameMetadata.cs b/src/ImageSharp/Formats/Tiff/TiffFrameMetadata.cs index 7d79f7a85c..363e68cee3 100644 --- a/src/ImageSharp/Formats/Tiff/TiffFrameMetadata.cs +++ b/src/ImageSharp/Formats/Tiff/TiffFrameMetadata.cs @@ -194,7 +194,19 @@ namespace SixLabors.ImageSharp.Formats.Experimental.Tiff /// /// Gets for each strip, the byte offset of that strip. /// - public Number[] StripOffsets => this.ExifProfile.GetValue(ExifTag.StripOffsets).Value; + public Number[] StripOffsets + { + get + { + IExifValue stripOffsets = this.ExifProfile.GetValue(ExifTag.StripOffsets); + if (stripOffsets == null) + { + TiffThrowHelper.ThrowImageFormatException("StripOffsets are missing"); + } + + return stripOffsets.Value; + } + } /// /// Gets the number of components per pixel. @@ -221,7 +233,19 @@ namespace SixLabors.ImageSharp.Formats.Experimental.Tiff /// /// Gets for each strip, the number of bytes in the strip after compression. /// - public Number[] StripByteCounts => this.ExifProfile.GetValue(ExifTag.StripByteCounts).Value; + public Number[] StripByteCounts + { + get + { + IExifValue stripByteCounts = this.ExifProfile.GetValue(ExifTag.StripByteCounts); + if (stripByteCounts == null) + { + TiffThrowHelper.ThrowImageFormatException("StripByteCounts are missing"); + } + + return stripByteCounts.Value; + } + } /// /// Gets the resolution of the image in x- direction.