Closed kingargyle closed 7 years ago
I have the same issue, actually my RecyclerView has an EndLessScrollListener to append items, however, when i refresh (vía OnRefreshListener) i got the same NPE.
@TonicArtos any possibility of taking a look into this, this is affecting our production application with 0.4 branch. If you can point me in the general direction to try and fix the issue, I'm more than willing to provide a pull request.
For me this may be fixed by upgrading to version 0.4.13, I need to do some more testing to make sure.
I actually upgraded to 0.4.14, however my issue is I've added an ScrollListener to my RecycleView, so when I do refresh (With SwipeLayout) i got this NPE, I fixed this removing and adding the listener when correspond. If somebody has a better fix for this issue, tell me, but i'll keep on testing...
Ok for me this seems to be fixed with version 0.4.13. I'll leave open since @OllieStrevel got the issue by doing things a different way.
@kingargyle Hi, I'm glad 0.4.13 seems to have resolved the problem. There were fixes to related code in 0.4.13, perhaps that is what fixed it. Well, I'll check to see what happened anyway.
@OllieStrevel I presume you mean 0.4.13. There is probably some state not being regenerated for some reason, causing the NPE. I haven't looked into what this is yet, but I'll get to it.
I am having similar crash with a LG-D393 and 0.4.13. For now, only reproducible in this device.
mOnScrollListener = new RecyclerView.OnScrollListener() {
@Override
public void onScrolled(RecyclerView recyclerView, int dx, int dy) {
super.onScrolled(recyclerView, dx, dy);
....
int mFirstVisibleItem = 0;
try {
mFirstVisibleItem = getLayoutManager().findFirstVisibleItemPosition();
} catch (Exception e) {
//Hacky fix to prevent crash because of Null Pointer Exception happenning in LG device
e.printStackTrace();
}
....
}
I know about the problem and there is a fix in the works. This problem is rooted in the original design of SuperSLiM and so I had to go back and start over. To see current progress you can check out the version5 branch.
We got the following stack trace with 0.4.11, I haven't tried upgrading yet to 0.4.13: Caused by: java.lang.NullPointerException at com.tonicartos.superslim.SectionData.(SourceFile:36)
at com.tonicartos.superslim.LayoutManager.findFirstVisibleItem(SourceFile:148)
at com.tonicartos.superslim.LayoutManager.findFirstVisibleItemPosition(SourceFile:179)