diff --git a/library/src/main/java/com/github/ksoichiro/android/observablescrollview/ObservableRecyclerView.java b/library/src/main/java/com/github/ksoichiro/android/observablescrollview/ObservableRecyclerView.java
index <HASH>..<HASH> 100644
--- a/library/src/main/java/com/github/ksoichiro/android/observablescrollview/ObservableRecyclerView.java
+++ b/library/src/main/java/com/github/ksoichiro/android/observablescrollview/ObservableRecyclerView.java
@@ -103,8 +103,10 @@ public class ObservableRecyclerView extends RecyclerView implements Scrollable {
                 for (int i = firstVisiblePosition, j = 0; i <= lastVisiblePosition; i++, j++) {
                     int childHeight = 0;
                     View child = getChildAt(j);
-                    if (mChildrenHeights.indexOfKey(i) < 0 || (child != null && child.getHeight() != mChildrenHeights.get(i))) {
-                        childHeight = child.getHeight();
+                    if (child != null) {
+                        if (mChildrenHeights.indexOfKey(i) < 0 || (child.getHeight() != mChildrenHeights.get(i))) {
+                            childHeight = child.getHeight();
+                        }
                     }
                     mChildrenHeights.put(i, childHeight);
                 }
Fixed NPE when mChildrenHeights.indexOfKey(i) < 0 in ObservableRecyclerView.