Skip to content

Commit e7cc563

Browse files
committed
Fixed QR code scan bug
1 parent ca847c2 commit e7cc563

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

BitStore/Utils/URI.m

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,15 @@ - (id)initWithString:(NSString *)string {
1818
_address = [query substringToIndex:queryStart.location];
1919

2020
NSRange amountStart = [query rangeOfString:@"amount="];
21-
NSString* amountAndMore = [query substringFromIndex:amountStart.location + 7];
22-
23-
NSRange additionalQueryStart = [amountAndMore rangeOfString:@"&"];
24-
if (additionalQueryStart.length > 0) {
25-
// more parms in query, cut of
26-
amountAndMore = [amountAndMore substringToIndex:additionalQueryStart.location];
21+
if (amountStart.length > 0) {
22+
NSString* amountAndMore = [query substringFromIndex:amountStart.location + 7];
23+
NSRange additionalQueryStart = [amountAndMore rangeOfString:@"&"];
24+
if (additionalQueryStart.length > 0) {
25+
// more parms in query, cut of
26+
amountAndMore = [amountAndMore substringToIndex:additionalQueryStart.location];
27+
}
28+
_amount = amountAndMore;
2729
}
28-
29-
_amount = amountAndMore;
3030
}
3131
}
3232
return self;

0 commit comments

Comments
 (0)