Skip to content

Commit

Permalink
fix: Prevent NPE when adding reaction to announcement
Browse files Browse the repository at this point in the history
  • Loading branch information
nikclayton committed Nov 26, 2024
1 parent 982963b commit d6d4384
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ class AnnouncementsViewModel @Inject constructor(
{
announcementsMutable.postValue(
Success(
announcements.value!!.data!!.map { announcement ->
announcements.value?.data?.map { announcement ->
if (announcement.id == announcementId) {
announcement.copy(
reactions = if (announcement.reactions.find { reaction -> reaction.name == name } != null) {
Expand Down

0 comments on commit d6d4384

Please sign in to comment.