mirror of
https://github.com/mihonapp/mihon.git
synced 2025-11-15 05:27:28 +01:00
Fix #517 and a few more crashes
This commit is contained in:
@@ -9,6 +9,7 @@ import android.util.AttributeSet
|
||||
import com.afollestad.materialdialogs.MaterialDialog
|
||||
import eu.kanade.tachiyomi.BuildConfig
|
||||
import eu.kanade.tachiyomi.R
|
||||
import eu.kanade.tachiyomi.data.library.LibraryUpdateJob
|
||||
import eu.kanade.tachiyomi.data.preference.PreferencesHelper
|
||||
import eu.kanade.tachiyomi.data.preference.getOrDefault
|
||||
import eu.kanade.tachiyomi.data.updater.UpdateCheckerJob
|
||||
@@ -23,9 +24,10 @@ class ChangelogDialogFragment : DialogFragment() {
|
||||
preferences.lastVersionCode().set(BuildConfig.VERSION_CODE)
|
||||
ChangelogDialogFragment().show(fragmentManager, "changelog")
|
||||
|
||||
// FIXME Ugly check to restore auto updates setting. Remove me in a few months :D
|
||||
// FIXME Ugly check to restore jobs. Remove me in a few months :D
|
||||
if (oldVersion < 14 && BuildConfig.INCLUDE_UPDATER && preferences.automaticUpdates()) {
|
||||
UpdateCheckerJob.setupTask()
|
||||
LibraryUpdateJob.setupTask()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -71,7 +71,7 @@ class SettingsAdvancedFragment : SettingsFragment() {
|
||||
private fun clearChapterCache() {
|
||||
val deletedFiles = AtomicInteger()
|
||||
|
||||
val files = chapterCache.cacheDir.listFiles()
|
||||
val files = chapterCache.cacheDir.listFiles() ?: return
|
||||
|
||||
val dialog = MaterialDialog.Builder(activity)
|
||||
.title(R.string.deleting)
|
||||
|
||||
Reference in New Issue
Block a user