diff --git a/SSZipArchive/SSZipArchive.m b/SSZipArchive/SSZipArchive.m index 7730057..d2f831c 100755 --- a/SSZipArchive/SSZipArchive.m +++ b/SSZipArchive/SSZipArchive.m @@ -848,8 +848,10 @@ NSString *temporaryDirectoryName = [[NSUUID UUID] UUIDString]; NSString *temporaryDirectory = [NSTemporaryDirectory() stringByAppendingPathComponent:temporaryDirectoryName]; BOOL directoryCreated = [[NSFileManager defaultManager] createDirectoryAtPath:temporaryDirectory withIntermediateDirectories:YES attributes:nil error:nil]; - discardableFilePath = directoryCreated ? [temporaryDirectory stringByAppendingPathComponent:discardableFileName] : nil; - [@"" writeToFile:discardableFilePath atomically:YES encoding:NSUTF8StringEncoding error:nil]; + if (directoryCreated) { + discardableFilePath = [temporaryDirectory stringByAppendingPathComponent:discardableFileName]; + [@"" writeToFile:discardableFilePath atomically:YES encoding:NSUTF8StringEncoding error:nil]; + } }); return discardableFilePath; } diff --git a/ZipArchive.xcodeproj/project.pbxproj b/ZipArchive.xcodeproj/project.pbxproj index eece749..d5a3be7 100644 --- a/ZipArchive.xcodeproj/project.pbxproj +++ b/ZipArchive.xcodeproj/project.pbxproj @@ -463,6 +463,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; @@ -476,7 +477,7 @@ CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES_AGGRESSIVE; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; COPY_PHASE_STRIP = NO; CURRENT_PROJECT_VERSION = 1; @@ -511,6 +512,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; @@ -524,7 +526,7 @@ CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES_AGGRESSIVE; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; COPY_PHASE_STRIP = YES; CURRENT_PROJECT_VERSION = 1;