Skip to content

Commit

Permalink
Fix crash: View my recovery phrase with less than 24 words
Browse files Browse the repository at this point in the history
  • Loading branch information
Foboz committed Feb 20, 2019
1 parent c2542f1 commit 84096f0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Configurations/application.xcconfig
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
APPLICATION_VERSION=1.0.9
APPLICATION_BUILD=19021901
APPLICATION_BUILD=19022002
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,12 @@ - (void) setupInitialStateWithWords:(NSArray<NSString *> *)words readOnly:(BOOL)
self.descriptionLabel.attributedText = [[NSAttributedString alloc] initWithString:self.descriptionLabel.text attributes:attributes];
}
{ //Words
NSArray *wordsPart1 = [words subarrayWithRange:NSMakeRange(0, 12)];
NSUInteger firstHalfCount = [words count] / 2 + [words count] % 2;
NSArray *wordsPart1 = [words subarrayWithRange:NSMakeRange(0, firstHalfCount)];
[self _prepareWordsList:wordsPart1 inLabel:self.wordsPart1Label startIndex:1];
NSArray *wordsPart2 = [words subarrayWithRange:NSMakeRange(12, 12)];
[self _prepareWordsList:wordsPart2 inLabel:self.wordsPart2Label startIndex:13];
NSUInteger secondHalpCount = [words count] - firstHalfCount;
NSArray *wordsPart2 = [words subarrayWithRange:NSMakeRange(firstHalfCount, secondHalpCount)];
[self _prepareWordsList:wordsPart2 inLabel:self.wordsPart2Label startIndex:firstHalfCount + 1];
}
{ //Beware label
NSMutableParagraphStyle *style = [[NSMutableParagraphStyle alloc] init];
Expand Down

0 comments on commit 84096f0

Please sign in to comment.