DevAhamed / MultiViewAdapter

Easily create complex recyclerview adapters in android
https://devahamed.github.io/MultiViewAdapter
Apache License 2.0
820 stars 149 forks source link

Fix NPE thrown by ItemSection #87

Closed DevAhamed closed 5 years ago

DevAhamed commented 5 years ago

ItemSection when added to an adapter and is not initialized with an item, throws NPE when expansion/selection is toggled. Check whether the item is initialized before accessing the expansion/selection fixes the issue.

codecov-io commented 5 years ago

Codecov Report

Merging #87 into 2.x will increase coverage by 0.41%. The diff coverage is 30%.

Impacted file tree graph

@@            Coverage Diff             @@
##              2.x      #87      +/-   ##
==========================================
+ Coverage   73.25%   73.67%   +0.41%     
==========================================
  Files          20       20              
  Lines        1148     1147       -1     
  Branches      169      169              
==========================================
+ Hits          841      845       +4     
+ Misses        213      203      -10     
- Partials       94       99       +5
Impacted Files Coverage Δ
...dapter/src/main/java/mva2/adapter/ItemSection.java 54.54% <30%> (-2.18%) :arrow_down:
...r/src/main/java/mva2/adapter/MultiViewAdapter.java 74.43% <0%> (+0.56%) :arrow_up:
...pter/src/main/java/mva2/adapter/NestedSection.java 76.47% <0%> (+1.8%) :arrow_up:
...pter/src/main/java/mva2/adapter/HeaderSection.java 59.09% <0%> (+2.27%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 39f7bfb...989ed56. Read the comment docs.