From d6216760e4ff33dd0478c2c8e0b090fa17a92575 Mon Sep 17 00:00:00 2001 From: Shazron Abdullah Date: Tue, 6 Oct 2015 13:14:21 -0700 Subject: [PATCH] Fixes #153 - Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** +[NSString stringWithUTF8String:]: NULL cString' #153 --- src/ios-deploy.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/ios-deploy.c b/src/ios-deploy.c index 779682f..82d6dae 100644 --- a/src/ios-deploy.c +++ b/src/ios-deploy.c @@ -1401,6 +1401,9 @@ void download_tree(AMDeviceRef device) afc_connection* afc_conn_p = NULL; char *dirname = NULL; + list_root = list_root? list_root : "/"; + target_filename = target_filename? target_filename : "."; + NSString* targetPath = [NSString pathWithComponents:@[ @(target_filename), @(list_root)] ]; mkdirp([targetPath stringByDeletingLastPathComponent]); @@ -1419,7 +1422,7 @@ void download_tree(AMDeviceRef device) } } - read_dir(houseFd, afc_conn_p, list_root?list_root:"/", copy_file_callback); + read_dir(houseFd, afc_conn_p, list_root, copy_file_callback); } while(0);