Skip to content

Commit

Permalink
Fixed #357 - Check first if header != null
Browse files Browse the repository at this point in the history
(cherry picked from commit a5e949d)
  • Loading branch information
davideas committed May 9, 2017
1 parent 8c85ae1 commit a72fad9
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1628,7 +1628,7 @@ private void showAllHeadersWithReset(boolean init) {
T item = mItems.get(position);
// Reset hidden status! Necessary after the filter and the update
IHeader header = getHeaderOf(item);
if (!header.equals(sameHeader) && header != null && !isExpandable((T) header)) {
if (header != null && !header.equals(sameHeader) && !isExpandable((T) header)) {
sameHeader = header;
header.setHidden(true);
}
Expand Down Expand Up @@ -4219,7 +4219,7 @@ private void resetFilterFlags(List<T> items) {
// Restore headers visibility
if (headersShown) {
IHeader header = getHeaderOf(item);
if (!header.equals(sameHeader) && header != null && !isExpandable((T) header)) {
if (header != null && !header.equals(sameHeader) && !isExpandable((T) header)) {
header.setHidden(false);
sameHeader = header;
items.add(i, (T) header);
Expand Down Expand Up @@ -5502,7 +5502,7 @@ private void prepareItemsForUpdate(List<T> newItems) {
headersShown = true;
}
IHeader header = getHeaderOf(item);
if (header.equals(sameHeader) && header != null && !isExpandable((T) header)) {
if (header != null && header.equals(sameHeader) && !isExpandable((T) header)) {
header.setHidden(false);
sameHeader = header;
newItems.add(position, (T) header);
Expand Down

0 comments on commit a72fad9

Please sign in to comment.