mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-27 12:53:55 +01:00
Handle null value for artist (#2436)
This commit is contained in:
parent
0e2bd3ec0c
commit
d86a3aad79
1 changed files with 8 additions and 1 deletions
|
|
@ -1,5 +1,7 @@
|
||||||
package fr.free.nrw.commons.category;
|
package fr.free.nrw.commons.category;
|
||||||
|
|
||||||
|
import android.support.annotation.NonNull;
|
||||||
|
|
||||||
import org.w3c.dom.Element;
|
import org.w3c.dom.Element;
|
||||||
import org.w3c.dom.Node;
|
import org.w3c.dom.Node;
|
||||||
import org.w3c.dom.NodeList;
|
import org.w3c.dom.NodeList;
|
||||||
|
|
@ -109,8 +111,13 @@ public class CategoryImageUtils {
|
||||||
* @param document
|
* @param document
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
@NonNull
|
||||||
private static String getCreator(Node document) {
|
private static String getCreator(Node document) {
|
||||||
return StringUtils.getParsedStringFromHtml(getMetaDataValue(document, "Artist"));
|
String artist = getMetaDataValue(document, "Artist");
|
||||||
|
if (StringUtils.isNullOrWhiteSpace(artist)) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
return StringUtils.getParsedStringFromHtml(artist);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue