Skip to content

Commit

Permalink
try to fix RS crash at let userImageCache = UserImageLocalCache()
Browse files Browse the repository at this point in the history
  • Loading branch information
billypchan committed May 31, 2021
1 parent cbb94e9 commit 167e9a8
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Source/Utilis/UserImageLocalCache.swift
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ open class UserImageLocalCache : NSObject {
/// Create UserImageLocalCache
/// - parameter location: where cache is persisted on disk. Defaults to caches directory if nil.
@objc
public init(location: URL? = nil) {
public init(location: URL?) {

let largeUserImageCacheName = "largeUserImages"
let smallUserImageCacheName = "smallUserImages"
Expand Down
6 changes: 3 additions & 3 deletions Tests/Source/Model/User/UserImageLocalCacheTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class UserImageLocalCacheTests : BaseZMMessageTests {
testUser = ZMUser.insertNewObject(in:self.uiMOC)
testUser.remoteIdentifier = UUID.create()

sut = UserImageLocalCache()
sut = UserImageLocalCache(location: nil)
}

override func tearDown() {
Expand All @@ -61,7 +61,7 @@ class UserImageLocalCacheTests : BaseZMMessageTests {
// when
sut.setUserImage(testUser, imageData: largeData, size: .complete)
sut.setUserImage(testUser, imageData: smallData, size: .preview)
sut = UserImageLocalCache()
sut = UserImageLocalCache(location: nil)

// then
let previewImageArrived = expectation(description: "Preview image arrived")
Expand Down Expand Up @@ -117,7 +117,7 @@ extension UserImageLocalCacheTests {
// when
sut.setUserImage(testUser, imageData: largeData, size: .complete)
sut.setUserImage(testUser, imageData: smallData, size: .preview)
sut = UserImageLocalCache()
sut = UserImageLocalCache(location: nil)

// then
XCTAssertEqual(sut.userImage(testUser, size: .complete), largeData)
Expand Down
2 changes: 2 additions & 0 deletions WireDataModel.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3615,6 +3615,7 @@
INFOPLIST_FILE = "$(SRCROOT)/Resources/Info.plist";
MOMC_NO_INVERSE_RELATIONSHIP_WARNINGS = YES;
PRODUCT_BUNDLE_IDENTIFIER = com.wire.WireDataModel;
SWIFT_VERSION = 5.0;
};
name = Debug;
};
Expand All @@ -3627,6 +3628,7 @@
MOMC_NO_INVERSE_RELATIONSHIP_WARNINGS = YES;
PRODUCT_BUNDLE_IDENTIFIER = com.wire.WireDataModel;
SWIFT_OPTIMIZATION_LEVEL = "-O";
SWIFT_VERSION = 5.0;
};
name = Release;
};
Expand Down

0 comments on commit 167e9a8

Please sign in to comment.