mirror of
https://github.com/kiwix/kiwix-android.git
synced 2025-08-04 03:06:41 -04:00
Fixed: Application crashes at first launch.
This commit is contained in:
parent
af8ca7f620
commit
fe3597aa7b
@ -270,9 +270,10 @@ class KiwixReaderFragment : CoreReaderFragment() {
|
||||
when (restoreOrigin) {
|
||||
FromExternalLaunch -> {
|
||||
coreReaderLifeCycleScope?.launch {
|
||||
if (!isAdded) return@launch
|
||||
val settings =
|
||||
requireActivity().getSharedPreferences(SharedPreferenceUtil.PREF_KIWIX_MOBILE, 0)
|
||||
val zimReaderSource = fromDatabaseValue(settings.getString(TAG_CURRENT_FILE, null))
|
||||
activity?.getSharedPreferences(SharedPreferenceUtil.PREF_KIWIX_MOBILE, 0)
|
||||
val zimReaderSource = fromDatabaseValue(settings?.getString(TAG_CURRENT_FILE, null))
|
||||
if (zimReaderSource?.canOpenInLibkiwix() == true) {
|
||||
if (zimReaderContainer?.zimReaderSource == null) {
|
||||
openZimFile(zimReaderSource, isFromManageExternalLaunch = true)
|
||||
|
Loading…
x
Reference in New Issue
Block a user