sourcegit-scm / sourcegit

Windows/macOS/Linux GUI client for GIT users
MIT License
668 stars 69 forks source link

Occasional crash exception in TextDiff #130

Closed gadfly3173 closed 2 months ago

gadfly3173 commented 2 months ago

I was unable to reliably reproduce this exception, and the crash occurred while I was inspecting locally changed file contents. Maybe add some exception handling to prevent crashes?

Crash: Operation is not valid due to the current state of the object.

----------------------------
Version: 8.12.0.0
OS: Unix 5.15.77.64
Framework: .NETCoreApp,Version=v8.0
Source: <unknown>
---------------------------

   at AvaloniaEdit.Document.DocumentLine.get_LineNumber() + 0x3b
   at SourceGit.Views.CombinedTextDiffPresenter.LineBackgroundRenderer.Draw(TextView textView, DrawingContext drawingContext) + 0xec
   at AvaloniaEdit.Rendering.TextView.RenderBackground(DrawingContext, KnownLayer) + 0xaf
   at AvaloniaEdit.Rendering.TextView.Render(DrawingContext) + 0x60
   at Avalonia.Rendering.Composition.CompositingRenderer.UpdateCore() + 0x8b
   at Avalonia.Rendering.Composition.CompositingRenderer.Update() + 0x23
   at Avalonia.Rendering.Composition.Compositor.CommitCore() + 0xba
   at Avalonia.Rendering.Composition.Compositor.Commit() + 0x16
   at Avalonia.Media.MediaContext.CommitCompositor(Compositor) + 0x44
   at Avalonia.Media.MediaContext.CommitCompositorsWithThrottling() + 0x75
   at Avalonia.Media.MediaContext.CompositionBatchFinished(Compositor, CompositionBatch) + 0x67
   at Avalonia.Threading.DispatcherOperation.InvokeCore() + 0x184
   at Avalonia.Threading.DispatcherOperation.Execute() + 0x72
   at Avalonia.Threading.Dispatcher.ExecuteJob(DispatcherOperation) + 0x5f
   at Avalonia.Threading.Dispatcher.ExecuteJobsCore(Boolean) + 0xa0
   at Avalonia.Threading.Dispatcher.Signaled() + 0x3e
   at Avalonia.X11.X11PlatformThreading.CheckSignaled() + 0x5d
   at Avalonia.X11.X11PlatformThreading.RunLoop(CancellationToken) + 0x250
   at Avalonia.Threading.DispatcherFrame.Run(IControlledDispatcherImpl) + 0xff
   at Avalonia.Threading.Dispatcher.PushFrame(DispatcherFrame) + 0xb7
   at Avalonia.Threading.Dispatcher.MainLoop(CancellationToken) + 0x10c
   at Avalonia.Controls.ApplicationLifetimes.ClassicDesktopStyleApplicationLifetime.Start(String[]) + 0x50
   at SourceGit.App.Main(String[] args) + 0x37
love-linger commented 2 months ago

This could be a BUG belonging to AvaloniaEdit