Skip to content

Commit

Permalink
Fixed #357 - Check first if header != null
Browse files Browse the repository at this point in the history
  • Loading branch information
davideas committed May 7, 2017
1 parent 61a58e0 commit a5e949d
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 = getItem(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 @@ -4220,7 +4220,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 @@ -5503,7 +5503,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 a5e949d

Please sign in to comment.