Improve string casting of revision info values

Some revision payloads contain git hashes in place of revision number
for built-in components (webkit, v8).
We should use universal -description instead of NSNumber's -stringValue.

See revision #278870 for example.
This commit is contained in:
Artur Petrov 2014-09-29 03:45:37 +04:00
parent 818a02edbd
commit 2c27526ab5

View File

@ -382,12 +382,12 @@ NSString * const MGMUBCancel = @"Cancel";
} }
- (void)revisionDidFinish:(MGMURLBasicHandler *)theHandler { - (void)revisionDidFinish:(MGMURLBasicHandler *)theHandler {
NSDictionary *revisionInfo = [[theHandler data] parseJSON]; NSDictionary *revisionInfo = [[theHandler data] parseJSON];
NSString *webkit = [[revisionInfo objectForKey:@"webkit_revision"] stringValue]; NSString *webkit = [NSString stringWithFormat:@"%@", [revisionInfo objectForKey:@"webkit_revision"]];
if (webkit!=nil) if (webkit!=nil)
[webKitBuildField setStringValue:webkit]; [webKitBuildField setStringValue:webkit];
else else
[webKitBuildField setStringValue:@"0"]; [webKitBuildField setStringValue:@"0"];
NSString *v8 = [[revisionInfo objectForKey:@"v8_revision"] stringValue]; NSString *v8 = [NSString stringWithFormat:@"%@", [revisionInfo objectForKey:@"v8_revision"]];
if (v8!=nil) if (v8!=nil)
[v8BuildField setStringValue:v8]; [v8BuildField setStringValue:v8];
else else