mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-03 17:56:44 +02:00
[Thumbnail providers] Cover errors and edge cases (#23947)
* [Thumbnail providers] Cover errors and edge cases * Add TODO comment * Fix tests
This commit is contained in:
@@ -159,12 +159,10 @@ namespace Microsoft.PowerToys.ThumbnailHandler.Gcode
|
||||
|
||||
using (var reader = new StreamReader(this.Stream))
|
||||
{
|
||||
using (Bitmap thumbnail = GetThumbnail(reader, cx))
|
||||
Bitmap thumbnail = GetThumbnail(reader, cx);
|
||||
if (thumbnail != null && thumbnail.Size.Width > 0 && thumbnail.Size.Height > 0)
|
||||
{
|
||||
if (thumbnail != null && thumbnail.Size.Width > 0 && thumbnail.Size.Height > 0)
|
||||
{
|
||||
return (Bitmap)thumbnail.Clone();
|
||||
}
|
||||
return thumbnail;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user