Skip to content

Commit

Permalink
Fixed NullReference
Browse files Browse the repository at this point in the history
  • Loading branch information
Pavel Leonenko committed Sep 24, 2024
1 parent 134f5ec commit 55eee72
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
using Softeq.XToolkit.Common.Collections;
using Softeq.XToolkit.Common.Collections.EventArgs;
using Softeq.XToolkit.Common.Commands;
using Softeq.XToolkit.Common.Extensions;
using Softeq.XToolkit.Common.Weak;

#nullable disable
Expand Down Expand Up @@ -108,7 +109,9 @@ public sealed override RecyclerView.ViewHolder OnCreateViewHolder(ViewGroup pare

public void DoAttachBindings()
{
_existingBindableViewHolders.ForEach(x => x.DoAttachBindings());
// ReSharper disable once ConditionIsAlwaysTrueOrFalse
_existingBindableViewHolders.Where(x => x.DataContext != null)
.Apply(x => x.DoAttachBindings());
}

public void DoDetachBindings()
Expand Down

0 comments on commit 55eee72

Please sign in to comment.