Dilar: fix NPE during extension loading (#2227)

This commit is contained in:
AwkwardPeak7 2024-04-01 19:32:26 +05:00 committed by Draff
parent 63c1a534a2
commit 01ab21ab4a
2 changed files with 6 additions and 5 deletions

View File

@ -2,7 +2,7 @@ ext {
extName = 'Dilar'
extClass = '.Dilar'
themePkg = 'gmanga'
overrideVersionCode = 1
overrideVersionCode = 2
}
apply from: "$rootDir/common.gradle"

View File

@ -61,10 +61,11 @@ class Dilar :
else -> preferences.getString(MIRROR_PREF_KEY, MIRROR_PREF_DEFAULT_VALUE)!!
}
override val baseUrl = mirrorPref()
override val baseUrl by lazy { mirrorPref() }
private val preferences: SharedPreferences =
override val cdnUrl by lazy { baseUrl }
private val preferences: SharedPreferences by lazy {
Injekt.get<Application>().getSharedPreferences("source_$id", 0x0000)
override val cdnUrl = baseUrl
}
}