mirror of
https://github.com/zhigang1992/RubyMotion.git
synced 2026-04-01 09:31:20 +08:00
avoid calling -[NSMutableString appendString:] with a nil argument
This commit is contained in:
16
bin/deploy.m
16
bin/deploy.m
@@ -590,12 +590,20 @@ start_debug_server(am_device_t dev)
|
||||
// Split the output into lines.
|
||||
char *p = strrchr(buf, '\n');
|
||||
if (p == NULL) {
|
||||
[data appendString:[[[NSString alloc] initWithCString:buf
|
||||
encoding:NSUTF8StringEncoding] autorelease]];
|
||||
NSString *tmp = [[NSString alloc] initWithCString:buf
|
||||
encoding:NSUTF8StringEncoding];
|
||||
if (tmp != nil) {
|
||||
[data appendString:tmp];
|
||||
[tmp release];
|
||||
}
|
||||
}
|
||||
else {
|
||||
[data appendString:[[[NSString alloc] initWithBytes:buf
|
||||
length:p-buf encoding:NSUTF8StringEncoding] autorelease]];
|
||||
NSString *tmp = [[NSString alloc] initWithBytes:buf
|
||||
length:p-buf encoding:NSUTF8StringEncoding];
|
||||
if (tmp != nil) {
|
||||
[data appendString:tmp];
|
||||
[tmp release];
|
||||
}
|
||||
|
||||
// Parse lines.
|
||||
NSArray *lines = [data componentsSeparatedByString:@"\n"];
|
||||
|
||||
Reference in New Issue
Block a user