Fix build breakage.

pull/1/head
matthew chen 7 years ago
parent da8da29215
commit 47aa29db25

@ -62,7 +62,10 @@ NS_ASSUME_NONNULL_BEGIN
{ {
BOOL isDirectory; BOOL isDirectory;
BOOL exists = [[NSFileManager defaultManager] fileExistsAtPath:path isDirectory:&isDirectory]; BOOL exists = [[NSFileManager defaultManager] fileExistsAtPath:path isDirectory:&isDirectory];
OWSAssert(exists); if (!exists) {
OWSFail(@"%@ error retrieving file attributes for issing file", self.logTag);
return;
}
if (isDirectory) { if (isDirectory) {
NSDirectoryEnumerator *directoryEnumerator = [[NSFileManager defaultManager] enumeratorAtPath:(NSString *)path]; NSDirectoryEnumerator *directoryEnumerator = [[NSFileManager defaultManager] enumeratorAtPath:(NSString *)path];
@ -72,10 +75,12 @@ NS_ASSUME_NONNULL_BEGIN
} else { } else {
NSError *error; NSError *error;
NSDictionary<NSFileAttributeKey, id> *_Nullable attributes = NSDictionary<NSFileAttributeKey, id> *_Nullable attributes =
[[NSFileManager defaultManager] attributesOfItemAtPath:path error:error]; [[NSFileManager defaultManager] attributesOfItemAtPath:path error:&error];
OWSAssert(!error); if (error) {
OWSFail(@"%@ error retrieving file attributes: %@", self.logTag, error);
DDLogDebug(@"%@ path: %@ has attributes: %@", self.logTag, path, attributes); } else {
DDLogDebug(@"%@ path: %@ has attributes: %@", self.logTag, path, attributes);
}
} }
} }

Loading…
Cancel
Save