Fix crash while searching when group somehow has nil members

This shouldn't normally happen, but seeing it on my device.

// FREEBIE
pull/1/head
Michael Kirk 8 years ago
parent a23f1b86ef
commit d6b3e191d1

@ -23,6 +23,22 @@ NS_ASSUME_NONNULL_BEGIN
return self;
}
- (nullable instancetype)initWithCoder:(NSCoder *)coder
{
self = [super initWithCoder:coder];
if (!self) {
return self;
}
// Occasionally seeing this as nil in legacy data,
// which causes crashes.
if (_groupMemberIds == nil) {
_groupMemberIds = [NSArray new];
}
return self;
}
- (BOOL)isEqual:(id)other {
if (other == self) {
return YES;

Loading…
Cancel
Save