From ee7af89783172d9dbbdae36d4c7a502216420e73 Mon Sep 17 00:00:00 2001 From: Steve Bilogan Date: Tue, 20 Jul 2021 14:19:36 -0400 Subject: [PATCH] fix(Scrolling): Fix null ref in scrolling logic --- src/Uno.UITest.Xamarin/XamarinApp.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Uno.UITest.Xamarin/XamarinApp.cs b/src/Uno.UITest.Xamarin/XamarinApp.cs index b631096..35903f1 100644 --- a/src/Uno.UITest.Xamarin/XamarinApp.cs +++ b/src/Uno.UITest.Xamarin/XamarinApp.cs @@ -266,13 +266,13 @@ namespace Uno.UITest.Xamarin => _source.ScrollDown(withinMarked, strategy.ToXamarinScrollStrategy(), swipePercentage, swipeSpeed, withInertia); public void ScrollDown(Func withinQuery = null, ScrollStrategy strategy = ScrollStrategy.Auto, double swipePercentage = 0.67, int swipeSpeed = 500, bool withInertia = true) - => _source.ScrollDown(q => withinQuery(q.AsGenericAppQuery()).ToXamarinQuery(), strategy.ToXamarinScrollStrategy(), swipePercentage, swipeSpeed, withInertia); + => _source.ScrollDown(q => withinQuery?.Invoke(q.AsGenericAppQuery()).ToXamarinQuery(), strategy.ToXamarinScrollStrategy(), swipePercentage, swipeSpeed, withInertia); public void ScrollDownTo(Func toQuery, Func withinQuery = null, ScrollStrategy strategy = ScrollStrategy.Auto, double swipePercentage = 0.67, int swipeSpeed = 500, bool withInertia = true, TimeSpan? timeout = null) - => _source.ScrollDownTo(q => toQuery(q.AsGenericAppQuery()).ToXamarinQuery(), q => withinQuery(q.AsGenericAppQuery()).ToXamarinQuery(), strategy.ToXamarinScrollStrategy(), swipePercentage, swipeSpeed, withInertia, timeout); + => _source.ScrollDownTo(q => toQuery(q.AsGenericAppQuery()).ToXamarinQuery(), q => withinQuery?.Invoke(q.AsGenericAppQuery()).ToXamarinQuery(), strategy.ToXamarinScrollStrategy(), swipePercentage, swipeSpeed, withInertia, timeout); public void ScrollDownTo(Func toQuery, Func withinQuery = null, ScrollStrategy strategy = ScrollStrategy.Auto, double swipePercentage = 0.67, int swipeSpeed = 500, bool withInertia = true, TimeSpan? timeout = null) - => _source.ScrollDownTo(q => toQuery(q.AsGenericAppQuery()).ToXamarinQuery(), q => withinQuery(q.AsGenericAppQuery()).ToXamarinQuery(), strategy.ToXamarinScrollStrategy(), swipePercentage, swipeSpeed, withInertia, timeout); + => _source.ScrollDownTo(q => toQuery(q.AsGenericAppQuery()).ToXamarinQuery(), q => withinQuery?.Invoke(q.AsGenericAppQuery()).ToXamarinQuery(), strategy.ToXamarinScrollStrategy(), swipePercentage, swipeSpeed, withInertia, timeout); public void ScrollDownTo(Func toQuery, string withinMarked, ScrollStrategy strategy = ScrollStrategy.Auto, double swipePercentage = 0.67, int swipeSpeed = 500, bool withInertia = true, TimeSpan? timeout = null) => _source.ScrollDownTo(q => toQuery(q.AsGenericAppQuery()).ToXamarinQuery(), withinMarked, strategy.ToXamarinScrollStrategy(), swipePercentage, swipeSpeed, withInertia, timeout); @@ -290,10 +290,10 @@ namespace Uno.UITest.Xamarin => _source.ScrollUp(withinMarked, strategy.ToXamarinScrollStrategy(), swipePercentage, swipeSpeed, withInertia); public void ScrollUpTo(Func toQuery, Func withinQuery = null, ScrollStrategy strategy = ScrollStrategy.Auto, double swipePercentage = 0.67, int swipeSpeed = 500, bool withInertia = true, TimeSpan? timeout = null) - => _source.ScrollUpTo(q => toQuery(q.AsGenericAppQuery()).ToXamarinQuery(), q => withinQuery(q.AsGenericAppQuery()).ToXamarinQuery(), strategy.ToXamarinScrollStrategy(), swipePercentage, swipeSpeed, withInertia, timeout); + => _source.ScrollUpTo(q => toQuery(q.AsGenericAppQuery()).ToXamarinQuery(), q => withinQuery?.Invoke(q.AsGenericAppQuery()).ToXamarinQuery(), strategy.ToXamarinScrollStrategy(), swipePercentage, swipeSpeed, withInertia, timeout); public void ScrollUpTo(Func toQuery, Func withinQuery = null, ScrollStrategy strategy = ScrollStrategy.Auto, double swipePercentage = 0.67, int swipeSpeed = 500, bool withInertia = true, TimeSpan? timeout = null) - => _source.ScrollUpTo(q => toQuery(q.AsGenericAppQuery()).ToXamarinQuery(), q => withinQuery(q.AsGenericAppQuery()).ToXamarinQuery(), strategy.ToXamarinScrollStrategy(), swipePercentage, swipeSpeed, withInertia, timeout); + => _source.ScrollUpTo(q => toQuery(q.AsGenericAppQuery()).ToXamarinQuery(), q => withinQuery?.Invoke(q.AsGenericAppQuery()).ToXamarinQuery(), strategy.ToXamarinScrollStrategy(), swipePercentage, swipeSpeed, withInertia, timeout); public void ScrollUpTo(Func toQuery, string withinMarked, ScrollStrategy strategy = ScrollStrategy.Auto, double swipePercentage = 0.67, int swipeSpeed = 500, bool withInertia = true, TimeSpan? timeout = null) => _source.ScrollUpTo(q => toQuery(q.AsGenericAppQuery()).ToXamarinQuery(), withinMarked, strategy.ToXamarinScrollStrategy(), swipePercentage, swipeSpeed, withInertia, timeout);