Skip to content

Commit

Permalink
Throw exception in MLContact on nil rosterGroups
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewrfennell authored and tmolitor-stud-tu committed Sep 2, 2024
1 parent 2b1278b commit 4c9528f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Monal/Classes/MLContact.m
Original file line number Diff line number Diff line change
Expand Up @@ -858,6 +858,9 @@ +(MLContact*) contactFromDictionary:(NSDictionary*) dic
contact.lastInteractionTime = nilExtractor([dic objectForKey:@"lastInteraction"]); //no default needed, already done in DataLayer
contact.rosterGroups = [dic objectForKey:@"rosterGroups"];
contact->_avatar = nil;

MLAssert(contact.rosterGroups != nil, @"rosterGroups must be non-nil (if a user is in no groups, it should be empty set)");

return contact;
}

Expand Down

0 comments on commit 4c9528f

Please sign in to comment.