Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Zero Length check #23783

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ void HandleRenderComplete(PerformanceTracker obj)

void NextButton_Clicked(object sender, EventArgs e)
{
if (_TestCases?.Count == 0 || _TestNumber + 1 > _TestCases?.Count)
if (_TestCases == null || _TestCases.Count == 0 || _TestNumber + 1 > _TestCases.Count)
MikeAlhayek marked this conversation as resolved.
Show resolved Hide resolved
return;

ViewModel.View = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,7 @@ void UpdatePosition(int position)

void SetCurrentItem(int carouselPosition)
{
if (ItemsViewAdapter?.ItemsSource?.Count == 0)
if (ItemsViewAdapter?.ItemsSource == null || ItemsViewAdapter.ItemsSource.Count == 0)
return;

var item = ItemsViewAdapter.ItemsSource.GetItem(carouselPosition);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,7 @@ void UpdatePosition(int position)

void SetCurrentItem(int carouselPosition)
{
if (ItemsViewAdapter?.ItemsSource?.Count == 0)
if (ItemsViewAdapter?.ItemsSource == null || ItemsViewAdapter.ItemsSource.Count == 0)
return;

var item = ItemsViewAdapter.ItemsSource.GetItem(carouselPosition);
Expand Down
4 changes: 2 additions & 2 deletions src/Core/src/Platform/Android/MauiSwipeView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ bool ShouldInterceptTouch(MotionEvent? e)

var items = GetSwipeItemsByDirection(swipeDirection);

if (items == null || items?.Count == 0)
if (items == null || items.Count == 0)
return false;

return ShouldInterceptScrollChildrenTouch(swipeDirection);
Expand Down Expand Up @@ -531,7 +531,7 @@ void UpdateSwipeItems()

ISwipeItems? items = GetSwipeItemsByDirection();

if (items?.Count == 0 || items == null)
if (items == null || items.Count == 0)
return;

_actionView = new LinearLayoutCompat(_context);
Expand Down
2 changes: 1 addition & 1 deletion src/Core/src/Platform/Tizen/MauiSwipeView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ void UpdateSwipeItems()

ISwipeItems? items = GetSwipeItemsByDirection();

if (items?.Count == 0 || items == null)
if (items == null || items.Count == 0)
return;

_actionView = new NView
Expand Down
Loading