{"action":"created","issue":{"url":"https://api.github.com/repos/edsilfer/sticky-index/issues/4","labels_url":"https://api.github.com/repos/edsilfer/sticky-index/issues/4/labels{/name}","comments_url":"https://api.github.com/repos/edsilfer/sticky-index/issues/4/comments","events_url":"https://api.github.com/repos/edsilfer/sticky-index/issues/4/events","html_url":"https://github.com/edsilfer/sticky-index/issues/4","id":93459506,"number":4,"title":"stickyindex expects at least two elements","user":{"login":"Isolus","id":3437355,"avatar_url":"https://avatars.githubusercontent.com/u/3437355?v=3","gravatar_id":"","url":"https://api.github.com/users/Isolus","html_url":"https://github.com/Isolus","followers_url":"https://api.github.com/users/Isolus/followers","following_url":"https://api.github.com/users/Isolus/following{/other_user}","gists_url":"https://api.github.com/users/Isolus/gists{/gist_id}","starred_url":"https://api.github.com/users/Isolus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Isolus/subscriptions","organizations_url":"https://api.github.com/users/Isolus/orgs","repos_url":"https://api.github.com/users/Isolus/repos","events_url":"https://api.github.com/users/Isolus/events{/privacy}","received_events_url":"https://api.github.com/users/Isolus/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-07-07T07:23:48Z","updated_at":"2015-07-07T12:41:53Z","closed_at":null,"body":"I tried your stickyindex implementation with an empty or one element list and got the exception below. It think it's related to the references to 'indexList.getChildAt(0)' and 'indexList.getChildAt(1)' in `IndexLayoutManager`.\r\n\r\n```\r\njava.lang.NullPointerException: Attempt to invoke virtual method 'android.view.View android.view.View.findViewById(int)' on a null object reference\r\n            at br.com.stickyindex.layout.IndexLayoutManager.update(IndexLayoutManager.java:57)\r\n            at br.com.stickyindex.listener.IndexScrollListener.notifySubscribers(IndexScrollListener.java:43)\r\n            at br.com.stickyindex.listener.IndexScrollListener.onScrolled(IndexScrollListener.java:26)\r\n            at android.support.v7.widget.RecyclerView.dispatchOnScrolled(RecyclerView.java:3630)\r\n            at android.support.v7.widget.RecyclerView.dispatchLayout(RecyclerView.java:2784)\r\n            at android.support.v7.widget.RecyclerView.onLayout(RecyclerView.java:2971)\r\n            at android.view.View.layout(View.java:15671)\r\n            at android.view.ViewGroup.layout(ViewGroup.java:5038)\r\n            at android.widget.RelativeLayout.onLayout(RelativeLayout.java:1076)\r\n            at android.view.View.layout(View.java:15671)\r\n            at android.view.ViewGroup.layout(ViewGroup.java:5038)\r\n            at android.support.v4.widget.SwipeRefreshLayout.onLayout(SwipeRefreshLayout.java:562)\r\n            at android.view.View.layout(View.java:15671)\r\n            at android.view.ViewGroup.layout(ViewGroup.java:5038)\r\n            at android.support.v4.view.ViewPager.onLayout(ViewPager.java:1626)\r\n            at android.view.View.layout(View.java:15671)\r\n            at android.view.ViewGroup.layout(ViewGroup.java:5038)\r\n            at android.support.design.widget.CoordinatorLayout.layoutChild(CoordinatorLayout.java:1000)\r\n            at android.support.design.widget.CoordinatorLayout.onLayoutChild(CoordinatorLayout.java:710)\r\n            at android.support.design.widget.ViewOffsetBehavior.onLayoutChild(ViewOffsetBehavior.java:42)\r\n            at android.support.design.widget.AppBarLayout$ScrollingViewBehavior.onLayoutChild(AppBarLayout.java:982)\r\n            at android.support.design.widget.CoordinatorLayout.onLayout(CoordinatorLayout.java:723)\r\n            at android.view.View.layout(View.java:15671)\r\n            at android.view.ViewGroup.layout(ViewGroup.java:5038)\r\n            at android.support.v4.widget.DrawerLayout.onLayout(DrawerLayout.java:907)\r\n            at android.view.View.layout(View.java:15671)\r\n            at android.view.ViewGroup.layout(ViewGroup.java:5038)\r\n            at android.widget.FrameLayout.layoutChildren(FrameLayout.java:579)\r\n            at android.widget.FrameLayout.onLayout(FrameLayout.java:514)\r\n            at android.view.View.layout(View.java:15671)\r\n            at android.view.ViewGroup.layout(ViewGroup.java:5038)\r\n            at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1703)\r\n            at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1557)\r\n            at android.widget.LinearLayout.onLayout(LinearLayout.java:1466)\r\n            at android.view.View.layout(View.java:15671)\r\n            at android.view.ViewGroup.layout(ViewGroup.java:5038)\r\n            at android.widget.FrameLayout.layoutChildren(FrameLayout.java:579)\r\n            at android.widget.FrameLayout.onLayout(FrameLayout.java:514)\r\n            at android.view.View.layout(View.java:15671)\r\n            at android.view.ViewGroup.layout(ViewGroup.java:5038)\r\n            at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1703)\r\n            at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1557)\r\n            at android.widget.LinearLayout.onLayout(LinearLayout.java:1466)\r\n            at android.view.View.layout(View.java:15671)\r\n            at android.view.ViewGroup.layout(ViewGroup.java:5038)\r\n            at android.widget.FrameLayout.layoutChildren(FrameLayout.java:579)\r\n            at android.widget.FrameLayout.onLayout(FrameLayout.java:514)\r\n            at android.view.View.layout(View.java:15671)\r\n            at android.view.ViewGroup.layout(ViewGroup.java:5038)\r\n            at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:2086)\r\n            at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1843)\r\n            at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1061)\r\n            at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:5885)\r\n            at android.view.Choreographer$CallbackRecord.run(Choreographer.java:767)\r\n            at android.view.Choreographer.doCallbacks(Choreographer.java:580)\r\n            at android.view.Choreographer.doFrame(Choreographer.java:550)\r\n            at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:753)\r\n            at android.os.Handler.handleCallback(Handler.java:739)\r\n            at andr\r\n```"},"comment":{"url":"https://api.github.com/repos/edsilfer/sticky-index/issues/comments/119192259","html_url":"https://github.com/edsilfer/sticky-index/issues/4#issuecomment-119192259","issue_url":"https://api.github.com/repos/edsilfer/sticky-index/issues/4","id":119192259,"user":{"login":"edsilfer","id":12755321,"avatar_url":"https://avatars.githubusercontent.com/u/12755321?v=3","gravatar_id":"","url":"https://api.github.com/users/edsilfer","html_url":"https://github.com/edsilfer","followers_url":"https://api.github.com/users/edsilfer/followers","following_url":"https://api.github.com/users/edsilfer/following{/other_user}","gists_url":"https://api.github.com/users/edsilfer/gists{/gist_id}","starred_url":"https://api.github.com/users/edsilfer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edsilfer/subscriptions","organizations_url":"https://api.github.com/users/edsilfer/orgs","repos_url":"https://api.github.com/users/edsilfer/repos","events_url":"https://api.github.com/users/edsilfer/events{/privacy}","received_events_url":"https://api.github.com/users/edsilfer/received_events","type":"User","site_admin":false},"created_at":"2015-07-07T12:41:53Z","updated_at":"2015-07-07T12:41:53Z","body":"You're right again. I just need to add a check in the main if of ```update()``` method from ```IndexLayoutManager.java```.I'll try to fix it ASAP"}}