From 7b834b0e31d8eae47a625934ce0933765313f701 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 --- ios-deploy.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ios-deploy.c b/ios-deploy.c index e734fba..87168b2 100644 --- a/ios-deploy.c +++ b/ios-deploy.c @@ -1402,6 +1402,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]); @@ -1420,7 +1423,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);