[frontend/core] Fix potential null reference exceptions
This commit is contained in:
parent
49bd10bc68
commit
9ce293b8ba
3 changed files with 3 additions and 3 deletions
|
@ -36,7 +36,7 @@ internal class NoteStore : NoteMessageProvider, IDisposable
|
||||||
note.Poll = noteResponse.Poll;
|
note.Poll = noteResponse.Poll;
|
||||||
|
|
||||||
AnyNoteChanged?.Invoke(this, note);
|
AnyNoteChanged?.Invoke(this, note);
|
||||||
NoteChangedHandlers.First(p => p.Key == note.Id).Value.Invoke(this, note);
|
NoteChangedHandlers.FirstOrDefault(p => p.Key == note.Id).Value?.Invoke(this, note);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public void Delete(string id)
|
public void Delete(string id)
|
||||||
|
|
|
@ -87,7 +87,7 @@ internal class NotificationStore : NoteMessageProvider, IAsyncDisposable
|
||||||
el.Value.Note.Attachments = noteResponse.Attachments;
|
el.Value.Note.Attachments = noteResponse.Attachments;
|
||||||
el.Value.Note.Reactions = noteResponse.Reactions;
|
el.Value.Note.Reactions = noteResponse.Reactions;
|
||||||
el.Value.Note.Poll = noteResponse.Poll;
|
el.Value.Note.Poll = noteResponse.Poll;
|
||||||
NoteChangedHandlers.First(p => p.Key == noteResponse.Id).Value.Invoke(this, el.Value.Note);
|
NoteChangedHandlers.FirstOrDefault(p => p.Key == noteResponse.Id).Value?.Invoke(this, el.Value.Note);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,7 +37,7 @@ internal class RelatedStore : NoteMessageProvider, IDisposable
|
||||||
note.Reactions = noteResponse.Reactions;
|
note.Reactions = noteResponse.Reactions;
|
||||||
note.Poll = noteResponse.Poll;
|
note.Poll = noteResponse.Poll;
|
||||||
|
|
||||||
NoteChangedHandlers.First(p => p.Key == note.Id).Value.Invoke(this, note);
|
NoteChangedHandlers.FirstOrDefault(p => p.Key == note.Id).Value?.Invoke(this, note);
|
||||||
NoteChanged?.Invoke(this, note);
|
NoteChanged?.Invoke(this, note);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue