mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-23 05:05:00 +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
|
@ -475,7 +475,7 @@ namespace SourceGit.ViewModels
|
|||
if (IMG_EXTS.Contains(ext))
|
||||
{
|
||||
var stream = Commands.QueryFileContent.Run(_repo, _commit.SHA, file.Path);
|
||||
var bitmap = stream != null ? new Bitmap(stream) : null as Bitmap;
|
||||
var bitmap = stream.Length > 0 ? new Bitmap(stream) : null;
|
||||
Dispatcher.UIThread.Invoke(() =>
|
||||
{
|
||||
ViewRevisionFileContent = new Models.RevisionImageFile() { Image = bitmap };
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue