Skip to content

Fix : UninitializedPropertyAccessException #6248

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@ class UploadPresenter @Inject internal constructor(

private val compositeDisposable = CompositeDisposable()

lateinit var basicKvStoreFactory: (String) -> BasicKvStore

private var basicKvStoreFactory: ((String) -> BasicKvStore)? = null
/**
* Called by the submit button in [UploadActivity]
*/
Expand Down Expand Up @@ -132,14 +131,18 @@ class UploadPresenter @Inject internal constructor(
basicKvStoreFactory = factory
}

private fun getBasicKvStoreFactory(): (String) -> BasicKvStore {
return basicKvStoreFactory ?: throw IllegalStateException("basicKvStoreFactory has not been initialized")
}

/**
* Calls checkImageQuality of UploadMediaPresenter to check image quality of next image
*
* @param uploadItemIndex Index of next image, whose quality is to be checked
*/
override fun checkImageQuality(uploadItemIndex: Int) {
repository.getUploadItem(uploadItemIndex)?.let {
presenter.setupBasicKvStoreFactory(basicKvStoreFactory)
presenter.setupBasicKvStoreFactory(getBasicKvStoreFactory())
presenter.checkImageQuality(it, uploadItemIndex)
}
}
Expand Down