Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Force closed if my custom ViewGroup called onLayout directly #67

Open
hendrawd opened this issue Jun 22, 2017 · 0 comments
Open

Force closed if my custom ViewGroup called onLayout directly #67

hendrawd opened this issue Jun 22, 2017 · 0 comments

Comments

@hendrawd
Copy link

I have a custom ViewGroup that called onLayout directly, but this line scrollListener.updateHandlePosition(recyclerView); will make application force closed with error java.lang.NullPointerException: Attempt to invoke virtual method 'int android.support.v7.widget.RecyclerView.computeVerticalScrollOffset()' on a null object reference

Actually i could avoid the force closed easily by setting mFastScroller.setRecyclerView(mRecyclerView); twice: after findViewById and after mRecyclerView.setAdapter(mAdapter);

But i think it will be more useful if the library itself check for null object directly before set any value to it.

@hendrawd hendrawd changed the title Force close if my custom view group called onLayout directly Force close if my custom ViewGroup called onLayout directly Jun 22, 2017
@hendrawd hendrawd changed the title Force close if my custom ViewGroup called onLayout directly Force closed if my custom ViewGroup called onLayout directly Jun 22, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant