mirror of
https://github.com/oxen-io/session-android.git
synced 2025-08-11 21:27:52 +00:00
Quick fix crash
This commit is contained in:
@@ -14,8 +14,8 @@ class MessagingModuleConfiguration(
|
||||
lateinit var shared: MessagingModuleConfiguration
|
||||
|
||||
fun configure(context: Context,
|
||||
storage: StorageProtocol,
|
||||
messageDataProvider: MessageDataProvider
|
||||
storage: StorageProtocol,
|
||||
messageDataProvider: MessageDataProvider
|
||||
) {
|
||||
if (Companion::shared.isInitialized) { return }
|
||||
shared = MessagingModuleConfiguration(context, storage, messageDataProvider)
|
||||
|
@@ -373,8 +373,8 @@ object OnionRequestAPI {
|
||||
}
|
||||
val promise = deferred.promise
|
||||
promise.fail { exception ->
|
||||
val path = paths.firstOrNull { it.contains(guardSnode) }
|
||||
if (exception is HTTP.HTTPRequestFailedException) {
|
||||
if (exception is HTTP.HTTPRequestFailedException && SnodeModule.isInitialized) {
|
||||
val path = paths.firstOrNull { it.contains(guardSnode) }
|
||||
fun handleUnspecificError() {
|
||||
if (path == null) { return }
|
||||
var pathFailureCount = OnionRequestAPI.pathFailureCount[path] ?: 0
|
||||
|
@@ -8,8 +8,10 @@ class SnodeModule(val storage: LokiAPIDatabaseProtocol, val broadcaster: Broadca
|
||||
companion object {
|
||||
lateinit var shared: SnodeModule
|
||||
|
||||
val isInitialized: Boolean get() = Companion::shared.isInitialized
|
||||
|
||||
fun configure(storage: LokiAPIDatabaseProtocol, broadcaster: Broadcaster) {
|
||||
if (Companion::shared.isInitialized) { return }
|
||||
if (isInitialized) { return }
|
||||
shared = SnodeModule(storage, broadcaster)
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user