mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-22 04:34:59 +00:00
fix: crash when create image from a empty stream
This commit is contained in:
parent
75f6087447
commit
8adf11b64c
3 changed files with 5 additions and 5 deletions
|
@ -166,7 +166,7 @@ namespace SourceGit.ViewModels
|
|||
private Bitmap BitmapFromRevisionFile(string repo, string revision, string file)
|
||||
{
|
||||
var stream = Commands.QueryFileContent.Run(repo, revision, file);
|
||||
return stream != null ? new Bitmap(stream) : null;
|
||||
return stream.Length > 0 ? new Bitmap(stream) : null;
|
||||
}
|
||||
|
||||
private static readonly HashSet<string> IMG_EXTS = new HashSet<string>()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue