From c3c70d74976bb6d6e94fd784f5e1e3d7337b32fb Mon Sep 17 00:00:00 2001 From: Benoit Nolens Date: Tue, 18 Nov 2014 15:48:20 +0100 Subject: [PATCH] add nil to NSMutableArray bug fixed --- Pod/Classes/Hashids.m | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Pod/Classes/Hashids.m b/Pod/Classes/Hashids.m index 5fabc16..228ddd3 100644 --- a/Pod/Classes/Hashids.m +++ b/Pod/Classes/Hashids.m @@ -453,7 +453,10 @@ - (NSArray *) decode:(NSString *) encoded { NSString *salt = [NSString stringWithFormat:@"%d%@", (lottery_char & 12345), self.hashSalt]; inAlpha = [self consistentShuffle:inAlpha withSalt:salt]; - [results addObject:[self unhash:subhash withAlpha:inAlpha]]; + NSNumber *unhashed = [self unhash:subhash withAlpha:inAlpha]; + if (unhashed) { + [results addObject:unhashed]; + } } }