Merge pull request #4545 from nextcloud/ezaquarii/speculative-fix-for-npe-in-log-d

Fix for NPE caused by Log.d in ThumbnailsCacheManager
This commit is contained in:
Tobias Kaminsky 2019-09-27 09:23:28 +02:00 committed by GitHub
commit 8954aafb5f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -74,6 +74,7 @@ import java.io.InputStream;
import java.lang.ref.WeakReference;
import java.net.URLEncoder;
import java.util.List;
import java.util.Locale;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
@ -142,7 +143,7 @@ public final class ThumbnailsCacheManager {
mThumbnailCache = new DiskLruImageCache(diskCacheDir, DISK_CACHE_SIZE, mCompressFormat,
mCompressQuality);
} 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;
}
}