Fix for NPE caused by Log.d in ThumbnailsCacheManager

Log.d does not like null.

Fixes #4542

Signed-off-by: Chris Narkiewicz <hello@ezaquarii.com>
This commit is contained in:
Chris Narkiewicz 2019-09-23 18:38:23 +01:00
parent 6f8c91e446
commit ed704c632e
No known key found for this signature in database
GPG key ID: 30D28CA4CCC665C6

View file

@ -74,6 +74,7 @@ import java.io.InputStream;
import java.lang.ref.WeakReference; import java.lang.ref.WeakReference;
import java.net.URLEncoder; import java.net.URLEncoder;
import java.util.List; import java.util.List;
import java.util.Locale;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
@ -142,7 +143,7 @@ public final class ThumbnailsCacheManager {
mThumbnailCache = new DiskLruImageCache(diskCacheDir, DISK_CACHE_SIZE, mCompressFormat, mThumbnailCache = new DiskLruImageCache(diskCacheDir, DISK_CACHE_SIZE, mCompressFormat,
mCompressQuality); mCompressQuality);
} catch (Exception e) { } catch (Exception e) {
Log_OC.d(TAG, e.getMessage()); Log_OC.d(TAG, String.format(Locale.US, "Disk cache init failed: %s", e.getMessage()));
mThumbnailCache = null; mThumbnailCache = null;
} }
} }