Skip to content

Commit e8c02bb

Browse files
committed
Correctly return detected format
1 parent 3027c86 commit e8c02bb

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/ImageSharp.Textures/Texture.Decode.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,10 @@ private static ITextureFormat InternalDetectFormat(Stream stream, Configuration
4444
.Select(x => x.DetectFormat(buffer.Memory.Span))
4545
.LastOrDefault(x => x is not null);
4646

47-
TextureFormatManager.ThrowInvalidDecoder(config.ImageFormatsManager);
47+
if (format is null)
48+
{
49+
TextureFormatManager.ThrowInvalidDecoder(config.ImageFormatsManager);
50+
}
4851

4952
return format;
5053
}

0 commit comments

Comments
 (0)