Skip to content
This repository has been archived by the owner on Jan 24, 2022. It is now read-only.

Commit

Permalink
[springboard] don’t crash if the string isn’t localized
Browse files Browse the repository at this point in the history
  • Loading branch information
kirb committed Feb 15, 2016
1 parent 94ba7b0 commit a691823
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion springboard/HBTSStatusBarAlertServer.x
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,17 @@
break;
}

*boldRange = NSMakeRange([format rangeOfString:@"%@"].location, sender.length);
NSUInteger location = [format rangeOfString:@"%@"].location;

// if the %@ wasn’t found, the string probably isn’t translated… this is
// pretty bad so we should probably just return what we have so the error
// is obvious
if (location == NSNotFound) {
*boldRange = NSMakeRange(0, 0);
return format;
}

*boldRange = NSMakeRange(location, sender.length);

return [NSString stringWithFormat:format, sender];
break;
Expand Down

0 comments on commit a691823

Please sign in to comment.