Skip to content

Commit c19e298

Browse files
authored
fix: prevent NPE in RecyclerView controller when ref is undefined (#1922)
1 parent 600f11f commit c19e298

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/recyclerview/hooks/useRecyclerViewController.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ export function useRecyclerViewController<T>(
289289
}
290290
}
291291
setTimeout(() => {
292-
scrollViewRef.current!.scrollToEnd({ animated });
292+
scrollViewRef.current?.scrollToEnd({ animated });
293293
}, 0);
294294
},
295295

0 commit comments

Comments
 (0)