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

Commit 798b7f80 authored by alperozturk's avatar alperozturk Committed by backportbot[bot]
Browse files

onNoteLoaded npe checks

parent ca910337
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -148,8 +148,13 @@ class NoteDirectEditFragment : BaseNoteFragment(), Branded {
        disposables.add(timeoutDisposable)
    }

    override fun onNoteLoaded(note: Note) {
    override fun onNoteLoaded(note: Note?) {
        super.onNoteLoaded(note)
        if (note == null) {
            Log_OC.w(TAG, "Note is null, onNoteLoaded")
            return
        }

        Log.d(TAG, "onNoteLoaded() called")
        val newNoteParam = arguments?.getSerializable(PARAM_NEWNOTE) as Note?
        if (newNoteParam != null || note.remoteId == null) {
+5 −0
Original line number Diff line number Diff line
@@ -137,6 +137,11 @@ public class NotePreviewFragment extends SearchableBaseNoteFragment implements O
    @Override
    protected void onNoteLoaded(Note note) {
        super.onNoteLoaded(note);
        if (note == null) {
            Log_OC.w(TAG, "Note is null, onNoteLoaded");
            return;
        }

        noteLoaded = true;
        registerInternalNoteLinkHandler();