Commit d346e4ef authored by Geoffrey Métais's avatar Geoffrey Métais

Browser: prevent IndexOutOfBoundsException

parent 8f25dcfb
Pipeline #17209 passed with stage
in 3 minutes and 50 seconds
......@@ -575,6 +575,7 @@ abstract class BaseBrowserFragment : MediaBrowserFragment<BrowserModel>(), IRefr
override fun onMainActionClick(v: View, position: Int, item: MediaLibraryItem) {}
override fun onUpdateFinished(adapter: RecyclerView.Adapter<*>) {
if (!isStarted()) return
restoreMultiSelectHelper()
swipeRefreshLayout.isRefreshing = false
handler.sendEmptyMessage(MSG_HIDE_LOADING)
......
......@@ -106,6 +106,11 @@ abstract class MediaBrowserFragment<T : SortableModel> : BaseFragment(), Filtera
releaseBreadCrumb()
}
override fun onDestroy() {
super.onDestroy()
savedSelection.clear()
}
override fun onSaveInstanceState(outState: Bundle) {
getMultiHelper()?.let {
outState.putParcelable(KEY_SELECTION, SparseBooleanArrayParcelable(it.selectionMap))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment