Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Unverified Commit 04cd8af5 authored by alperozturk's avatar alperozturk
Browse files

requireContext crash

parent b0e3160f
Loading
Loading
Loading
Loading
+16 −14
Original line number Diff line number Diff line
@@ -188,9 +188,10 @@ class NoteDirectEditFragment : BaseNoteFragment(), Branded {

    private fun loadNoteInWebView(note: Note) {
        Log.d(TAG, "loadNoteInWebView() called")
        val directEditingRepository =
            DirectEditingRepository.getInstance(requireContext().applicationContext)
        val urlDisposable = directEditingRepository.getDirectEditingUrl(account, note)

        context?.let { context ->
            val repository = DirectEditingRepository.getInstance(context)
            val urlDisposable = repository.getDirectEditingUrl(account, note)
                .observeOn(AndroidSchedulers.mainThread()).subscribe({ url ->
                    url?.let {
                        if (BuildConfig.DEBUG) {
@@ -204,6 +205,7 @@ class NoteDirectEditFragment : BaseNoteFragment(), Branded {
                })
            disposables.add(urlDisposable)
        }
    }

    private fun handleLoadError() {
        val snackbar = BrandedSnackbar.make(