From bf95ef66eb918826421dfb122b8507707e8fdaf3 Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Wed, 25 Apr 2018 14:41:33 +0200 Subject: [PATCH] null check when cleaning avatars for muc --- .../eu/siacs/conversations/services/AvatarService.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main/java/eu/siacs/conversations/services/AvatarService.java b/src/main/java/eu/siacs/conversations/services/AvatarService.java index 1332811a6..80da03f07 100644 --- a/src/main/java/eu/siacs/conversations/services/AvatarService.java +++ b/src/main/java/eu/siacs/conversations/services/AvatarService.java @@ -321,7 +321,10 @@ public class AvatarService implements OnAdvancedStreamFeaturesLoaded { return bitmap; } - public void clear(MucOptions options) { + public void clear(final MucOptions options) { + if (options == null) { + return; + } synchronized (this.sizes) { for (Integer size : sizes) { this.mXmppConnectionService.getBitmapCache().remove(key(options, size)); @@ -329,7 +332,7 @@ public class AvatarService implements OnAdvancedStreamFeaturesLoaded { } } - private String key(MucOptions options, int size) { + private String key(final MucOptions options, int size) { synchronized (this.sizes) { if (!this.sizes.contains(size)) { this.sizes.add(size);