BeksOmega / looping-layout

A looping LayoutManager for the Android RecyclerView.
Apache License 2.0
274 stars 16 forks source link

fix: onSaveInstanceState null ptr exception. #40

Closed BeksOmega closed 4 years ago

BeksOmega commented 4 years ago

:clap: Resolves

Closes #39

:star2: Description

Fixes the null ptr exception occuring inside onSaveInstanceState. The issue is that when the screen is off on startup onSaveInstanceState is called (idk why) before any children can be created. So the call here actually returns null. An easy fix is just to check if any children exist. If not we return null from onSaveInstanceSTate, meaning there's no interesting state to save.

Also updates gradle

:bug: Testing

Could not reproduce #39 using the steps provided.

All unit tests pass.

:thought_balloon: Other info

N/A