Commit dc2cae1e authored by Soomin Lee's avatar Soomin Lee

VLCHTTP: Use firstObject to avoid potential crash

parent fd155dce
......@@ -622,7 +622,8 @@
// create the path where to store the media temporarily
NSArray *searchPaths = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES);
NSString *uploadDirPath = [searchPaths[0] stringByAppendingPathComponent:kVLCHTTPUploadDirectory];
NSString *uploadDirPath = [searchPaths.firstObject
stringByAppendingPathComponent:kVLCHTTPUploadDirectory];
NSFileManager *fileManager = [NSFileManager defaultManager];
BOOL isDir = YES;
......
......@@ -359,7 +359,8 @@
return;
NSArray *searchPaths = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES);
NSString* uploadDirPath = [searchPaths[0] stringByAppendingPathComponent:kVLCHTTPUploadDirectory];
NSString *uploadDirPath = [searchPaths.firstObject
stringByAppendingPathComponent:kVLCHTTPUploadDirectory];
NSFileManager *fileManager = [NSFileManager defaultManager];
if ([fileManager fileExistsAtPath:uploadDirPath])
[fileManager removeItemAtPath:uploadDirPath error:nil];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment