Merge pull request #4041 from nextcloud/ezaquarii/fix-weak-ref-dereference-npe-in-thumbnails-cache-manager

Fix NPE on weakref in ThumbnailsCacheManger
This commit is contained in:
Andy Scherzinger 2019-05-21 08:05:31 +02:00 committed by GitHub
commit 5c686ef313
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -841,10 +841,11 @@ public final class ThumbnailsCacheManager {
protected void onPostExecute(Drawable drawable) { protected void onPostExecute(Drawable drawable) {
if (drawable != null) { if (drawable != null) {
AvatarGenerationListener listener = mAvatarGenerationListener.get(); AvatarGenerationListener listener = mAvatarGenerationListener.get();
AvatarGenerationTask avatarWorkerTask = getAvatarWorkerTask(mCallContext); if (listener != null) {
AvatarGenerationTask avatarWorkerTask = getAvatarWorkerTask(mCallContext);
if (this == avatarWorkerTask && listener.shouldCallGeneratedCallback(mUserId, mCallContext)) { if (this == avatarWorkerTask && listener.shouldCallGeneratedCallback(mUserId, mCallContext)) {
listener.avatarGenerated(drawable, mCallContext); listener.avatarGenerated(drawable, mCallContext);
}
} }
} }
} }