From 4e717b170b15dbc36f1cd2e55fd11c890b9da771 Mon Sep 17 00:00:00 2001 From: Fero Date: Fri, 29 Oct 2021 18:47:24 +0200 Subject: [PATCH 1/2] Initialize imagesCacheLruCache before caching Caching operations would fail silently because cache not initialized --- MatrixSDK/Utils/Media/MXMediaManager.m | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/MatrixSDK/Utils/Media/MXMediaManager.m b/MatrixSDK/Utils/Media/MXMediaManager.m index c51a6b5c04..ef73ade893 100644 --- a/MatrixSDK/Utils/Media/MXMediaManager.m +++ b/MatrixSDK/Utils/Media/MXMediaManager.m @@ -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]; } From eeee719ac457bb2af0591594f503f3f041127c10 Mon Sep 17 00:00:00 2001 From: Fero Date: Fri, 29 Oct 2021 18:50:43 +0200 Subject: [PATCH 2/2] Create 1281.bugfix --- changelog.d/1281.bugfix | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog.d/1281.bugfix diff --git a/changelog.d/1281.bugfix b/changelog.d/1281.bugfix new file mode 100644 index 0000000000..4e215c85f0 --- /dev/null +++ b/changelog.d/1281.bugfix @@ -0,0 +1 @@ +Initialize imagesCacheLruCache before caching - caching operations would fail silently because cache was not initialized