mirror of
https://github.com/sourcegit-scm/sourcegit.git
synced 2024-12-25 21:07:20 -08:00
fix: avoid NRE
Signed-off-by: leo <longshuang@msn.cn>
This commit is contained in:
parent
3be90b2ef6
commit
f45bed6f92
1 changed files with 2 additions and 2 deletions
|
@ -1089,7 +1089,7 @@ namespace SourceGit.Views
|
||||||
public void ForceSyncScrollOffset()
|
public void ForceSyncScrollOffset()
|
||||||
{
|
{
|
||||||
if (DataContext is ViewModels.TwoSideTextDiff diff)
|
if (DataContext is ViewModels.TwoSideTextDiff diff)
|
||||||
diff.SyncScrollOffset = _scrollViewer.Offset;
|
diff.SyncScrollOffset = _scrollViewer?.Offset ?? Vector.Zero;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override List<Models.TextDiffLine> GetLines()
|
public override List<Models.TextDiffLine> GetLines()
|
||||||
|
@ -1302,7 +1302,7 @@ namespace SourceGit.Views
|
||||||
private void OnTextViewScrollChanged(object sender, ScrollChangedEventArgs e)
|
private void OnTextViewScrollChanged(object sender, ScrollChangedEventArgs e)
|
||||||
{
|
{
|
||||||
if (TextArea.IsFocused && DataContext is ViewModels.TwoSideTextDiff diff)
|
if (TextArea.IsFocused && DataContext is ViewModels.TwoSideTextDiff diff)
|
||||||
diff.SyncScrollOffset = _scrollViewer.Offset;
|
diff.SyncScrollOffset = _scrollViewer?.Offset ?? Vector.Zero;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnTextAreaPointerWheelChanged(object sender, PointerWheelEventArgs e)
|
private void OnTextAreaPointerWheelChanged(object sender, PointerWheelEventArgs e)
|
||||||
|
|
Loading…
Reference in a new issue