diff --git a/flexible-adapter/src/main/java/eu/davidea/flexibleadapter/helpers/StickyHeaderHelper.java b/flexible-adapter/src/main/java/eu/davidea/flexibleadapter/helpers/StickyHeaderHelper.java index 32341737..1d0c0936 100644 --- a/flexible-adapter/src/main/java/eu/davidea/flexibleadapter/helpers/StickyHeaderHelper.java +++ b/flexible-adapter/src/main/java/eu/davidea/flexibleadapter/helpers/StickyHeaderHelper.java @@ -111,6 +111,9 @@ private void initStickyHeadersHolder() { //Initialize Holder Layout and show sticky header if exists already mStickyHolderLayout = mAdapter.getStickySectionHeadersHolder(); if (mStickyHolderLayout != null) { + if (mStickyHolderLayout.getLayoutParams() == null) { + throw new IllegalStateException("The ViewGroup provided, doesn't have LayoutParams correctly set, please initialize the ViewGroup accordingly"); + } mStickyHolderLayout.setClipToPadding(false); mStickyHolderLayout.setAlpha(0); updateOrClearHeader(false);