Skip to content

Commit 7ed9118

Browse files
authored
commons-app#3579 p18Value causes NPE in WikidataEditService createClaimWithLogging - add null check (commons-app#3580)
1 parent 8cb4e28 commit 7ed9118

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

app/src/main/java/fr/free/nrw/commons/wikidata/WikidataEditService.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public class WikidataEditService {
5050
* @param fileName name of the file we will upload
5151
* @param p18Value pic attribute of Wikidata item
5252
*/
53-
public void createClaimWithLogging(String wikidataEntityId, String wikiItemName, String fileName, @NonNull String p18Value) {
53+
public void createClaimWithLogging(String wikidataEntityId, String wikiItemName, String fileName, String p18Value) {
5454
if (wikidataEntityId == null) {
5555
Timber.d("Skipping creation of claim as Wikidata entity ID is null");
5656
return;
@@ -66,7 +66,7 @@ public void createClaimWithLogging(String wikidataEntityId, String wikiItemName,
6666
return;
6767
}
6868

69-
if (!p18Value.trim().isEmpty()) {
69+
if (p18Value != null && !p18Value.trim().isEmpty()) {
7070
Timber.d("Skipping creation of claim as p18Value is not empty, we won't override existing image");
7171
return;
7272
}

0 commit comments

Comments
 (0)