null check when cleaning avatars for muc

This commit is contained in:
Daniel Gultsch 2018-04-25 14:41:33 +02:00
parent 09276eb396
commit bf95ef66eb
1 changed files with 5 additions and 2 deletions

View File

@ -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);