<NME> AvatarUtils.java
<BEF> package cgeo.geocaching.ui;

import cgeo.geocaching.connector.capability.IAvatar;
import cgeo.geocaching.network.HtmlImage;
import cgeo.geocaching.settings.Settings;

import android.graphics.drawable.BitmapDrawable;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

/** Class to retrieve Avatar images from. This class handles e.g. in-memory image caching */
public class AvatarUtils {

/**
 * Class to retrieve Avatar images from. This class handles e.g. in-memory image caching
 */
public class AvatarUtils {

    private static final HtmlImage HTML_IMAGE = new HtmlImage(HtmlImage.SHARED, false, false, false);

    private AvatarUtils() {
        // utility class
    }

    public static void changeAvatar(@NonNull final IAvatar avatar, final String newUrl) {
        if (!Objects.equals(Settings.getAvatarUrl(avatar), newUrl)) {
            Settings.setAvatarUrl(avatar, newUrl);
        }
    }
            return null;
        }
        final String url = Settings.getAvatarUrl(avatar);
        if (url == null) {
            return null;
        }
        synchronized (HTML_IMAGE) {
        if (avatar == null) {
            return null;
        }
        final String url = Settings.getAvatarUrl(avatar);
        if (StringUtils.isBlank(url)) {
            return null;
        }
        synchronized (HTML_IMAGE) {
            return HTML_IMAGE.getDrawable(url);
        }
    }

}

<MSG> Avatar URL can be blank instead of null. Handle this case correctly.

<DFF> @@ -9,6 +9,8 @@ import android.graphics.drawable.BitmapDrawable;
 import androidx.annotation.NonNull;
 import androidx.annotation.Nullable;
 
+import org.apache.commons.lang3.StringUtils;
+
 /** Class to retrieve Avatar images from. This class handles e.g. in-memory image caching */
 public class AvatarUtils {
 
@@ -31,7 +33,7 @@ public class AvatarUtils {
             return null;
         }
         final String url = Settings.getAvatarUrl(avatar);
-        if (url == null) {
+        if (StringUtils.isBlank(url)) {
             return null;
         }
         synchronized (HTML_IMAGE) {

Avatar URL can be blank instead of null. Handle this case correctly.