mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-27 04:43:54 +01:00
Fixes NPE in Util function
This commit is contained in:
parent
c0ff9ed09c
commit
8dd8e09f2a
4 changed files with 13 additions and 2 deletions
|
|
@ -3,6 +3,7 @@ package fr.free.nrw.commons;
|
|||
import android.content.Context;
|
||||
import android.os.Build;
|
||||
import android.preference.PreferenceManager;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.text.Html;
|
||||
import android.text.Spanned;
|
||||
|
||||
|
|
@ -127,7 +128,7 @@ public class Utils {
|
|||
return isoFormat.format(date);
|
||||
}
|
||||
|
||||
public static String makeThumbBaseUrl(String filename) {
|
||||
public static String makeThumbBaseUrl(@NonNull String filename) {
|
||||
String name = new PageTitle(filename).getPrefixedText();
|
||||
String sha = new String(Hex.encodeHex(DigestUtils.md5(name)));
|
||||
return String.format("%s/%s/%s/%s", BuildConfig.IMAGE_URL_BASE, sha.substring(0, 1), sha.substring(0, 2), urlEncode(name));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue