mirror of
https://github.com/sourcegit-scm/sourcegit.git
synced 2024-12-25 21:07:20 -08:00
Added safeguards for edge cases
This commit is contained in:
parent
b72f701324
commit
d0fd3ca6a0
1 changed files with 3 additions and 1 deletions
|
@ -1145,6 +1145,8 @@ namespace SourceGit.Views
|
||||||
|
|
||||||
public void ForceSyncScrollOffset()
|
public void ForceSyncScrollOffset()
|
||||||
{
|
{
|
||||||
|
if (_scrollViewer == null)
|
||||||
|
return;
|
||||||
if (DataContext is ViewModels.TwoSideTextDiff diff)
|
if (DataContext is ViewModels.TwoSideTextDiff diff)
|
||||||
diff.SyncScrollOffset = _scrollViewer?.Offset ?? Vector.Zero;
|
diff.SyncScrollOffset = _scrollViewer?.Offset ?? Vector.Zero;
|
||||||
}
|
}
|
||||||
|
@ -1584,7 +1586,7 @@ namespace SourceGit.Views
|
||||||
|
|
||||||
CurrentChangeBlockIdxProperty.Changed.AddClassHandler<TextDiffView>((v, e) =>
|
CurrentChangeBlockIdxProperty.Changed.AddClassHandler<TextDiffView>((v, e) =>
|
||||||
{
|
{
|
||||||
if (v.Editor.Presenter != null)
|
if ((int)e.NewValue >= 0 && v.Editor.Presenter != null)
|
||||||
{
|
{
|
||||||
foreach (var p in v.Editor.Presenter.GetVisualDescendants().OfType<ThemedTextDiffPresenter>())
|
foreach (var p in v.Editor.Presenter.GetVisualDescendants().OfType<ThemedTextDiffPresenter>())
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue