Skip to content

Commit

Permalink
Merge pull request #1281 from ferologics/patch-2
Browse files Browse the repository at this point in the history
Initialize imagesCacheLruCache before caching
  • Loading branch information
ismailgulek authored Nov 4, 2021
2 parents ab27061 + eeee719 commit 76bfce9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions MatrixSDK/Utils/Media/MXMediaManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,11 @@ + (void)cacheImage:(UIImage *)image withCachePath:(NSString *)filePath
+ (void)cacheImage:(NSImage *)image withCachePath:(NSString *)filePath
#endif
{
if (!imagesCacheLruCache)
{
imagesCacheLruCache = [[MXLRUCache alloc] initWithCapacity:20];
}

[imagesCacheLruCache put:filePath object:image];
}

Expand Down
1 change: 1 addition & 0 deletions changelog.d/1281.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Initialize imagesCacheLruCache before caching - caching operations would fail silently because cache was not initialized

0 comments on commit 76bfce9

Please sign in to comment.