check the right var for null

Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
This commit is contained in:
Andy Scherzinger 2023-12-06 10:22:44 +01:00
parent d6f77e2491
commit 7b4ecf7dc5
No known key found for this signature in database
GPG key ID: 6CADC7E3523C308B

View file

@ -467,7 +467,7 @@ public class ExtendedListFragment extends Fragment implements
private void scrollToPosition(int position) {
LinearLayoutManager linearLayoutManager = (LinearLayoutManager) mRecyclerView.getLayoutManager();
if (mRecyclerView != null) {
if (linearLayoutManager != null) {
int visibleItemCount = linearLayoutManager.findLastCompletelyVisibleItemPosition() -
linearLayoutManager.findFirstCompletelyVisibleItemPosition();
linearLayoutManager.scrollToPositionWithOffset(position, (visibleItemCount / 2) * mHeightCell);