Commit 58f4b5da authored by Felix Paul Kühne's avatar Felix Paul Kühne

title decrapifier: add missing exception handling (close #9435)

parent 481df3ef
...@@ -49,8 +49,12 @@ ...@@ -49,8 +49,12 @@
staticString = [staticString stringByReplacingOccurrencesOfString:@" " withString:@" "]; staticString = [staticString stringByReplacingOccurrencesOfString:@" " withString:@" "];
if (staticString.length > 2) { if (staticString.length > 2) {
if ([staticString characterAtIndex:0] == 0x20) @try {
staticString = [staticString substringFromIndex:1]; if ([staticString characterAtIndex:0] == 0x20)
staticString = [staticString substringFromIndex:1];
}
@catch (NSException *exception) {
}
} }
return staticString; return staticString;
...@@ -64,7 +68,12 @@ static inline BOOL isDigit(char c) ...@@ -64,7 +68,12 @@ static inline BOOL isDigit(char c)
// Shortcut to ease reading // Shortcut to ease reading
static inline unichar c(NSString *string, unsigned index) static inline unichar c(NSString *string, unsigned index)
{ {
return [string characterAtIndex:index]; @try {
return [string characterAtIndex:index];
}
@catch (NSException *exception) {
return 0x00;
}
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment