Skip to content

Commit

Permalink
Fix crash when picking destination folder
Browse files Browse the repository at this point in the history
  • Loading branch information
DSteve595 committed May 30, 2018
1 parent d4ddbe9 commit 3302d77
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ android {
applicationId 'com.stevenschoen.putionew'
minSdkVersion 21
targetSdkVersion 27
versionCode 129
versionName '4.3.0'
versionCode 130
versionName '4.3.1'
multiDexEnabled true

kapt {
Expand Down
20 changes: 12 additions & 8 deletions app/src/main/java/com/stevenschoen/putionew/files/FilesFragment.kt
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,19 @@ open class FilesFragment : RxFragment() {

setHasOptionsMenu(true)

if (savedInstanceState != null) {
pages.addAll(savedInstanceState.getParcelableArrayList(STATE_PAGES))
if (savedInstanceState.containsKey(STATE_CURRENT_PAGE)) {
currentPage = savedInstanceState.getParcelable(STATE_CURRENT_PAGE)
when {
savedInstanceState != null -> {
pages.addAll(savedInstanceState.getParcelableArrayList(STATE_PAGES))
if (savedInstanceState.containsKey(STATE_CURRENT_PAGE)) {
currentPage = savedInstanceState.getParcelable(STATE_CURRENT_PAGE)
}
}
arguments?.containsKey(EXTRA_FOLDER) == true -> {
pages.add(Page.File(arguments!!.getParcelable(EXTRA_FOLDER)))
}
else -> {
pages.add(Page.File(PutioFile.makeRootFolder(resources)))
}
} else if (arguments!!.containsKey(EXTRA_FOLDER)) {
pages.add(Page.File(arguments!!.getParcelable(EXTRA_FOLDER)))
} else {
pages.add(Page.File(PutioFile.makeRootFolder(resources)))
}
fileListFragmentsAdapter.notifyDataSetChanged()
}
Expand Down

0 comments on commit 3302d77

Please sign in to comment.