File tree 1 file changed +4
-7
lines changed
1 file changed +4
-7
lines changed Original file line number Diff line number Diff line change @@ -128,21 +128,18 @@ private static IImageFormat InternalDetectFormat(
128
128
// Does the given stream contain enough data to fit in the header for the format
129
129
// and does that data match the format specification?
130
130
// Individual formats should still check since they are public.
131
- IImageFormat ? format = null ;
132
131
foreach ( IImageFormatDetector formatDetector in configuration . ImageFormatsManager . FormatDetectors )
133
132
{
134
133
if ( formatDetector . HeaderSize <= headersBuffer . Length && formatDetector . TryDetectFormat ( headersBuffer , out IImageFormat ? attemptFormat ) )
135
134
{
136
- format = attemptFormat ;
135
+ return attemptFormat ;
137
136
}
138
137
}
139
138
140
- if ( format is null )
141
- {
142
- ImageFormatManager . ThrowInvalidDecoder ( configuration . ImageFormatsManager ) ;
143
- }
139
+ ImageFormatManager . ThrowInvalidDecoder ( configuration . ImageFormatsManager ) ;
144
140
145
- return format ;
141
+ // Need to write this otherwise compiler is not happy
142
+ return null ;
146
143
}
147
144
148
145
/// <summary>
You can’t perform that action at this time.
0 commit comments