Skip to content

Commit 48d70c7

Browse files
IgnacioGarcia198maskaravivek
authored andcommitted
Fixing#3210 When the place is not null but the descriptions list is empty there was a crash on getting the first element of the Descriptions list. (commons-app#3212)
* Deleted values-tt-cryl since it was causing an error and could not build the app. * Fix for issue commons-app#3210: When the place is not null but the descriptions list is empty there was a crash on getting the first element of the Descriptions list. I just check if the list is empty, and in that case I add a new Description to the list. * Revert "Deleted values-tt-cryl since it was causing an error and could not build the app." This reverts commit b0f4392 I reverted deleting the folder.
1 parent b7f97ab commit 48d70c7

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

app/src/main/java/fr/free/nrw/commons/upload/UploadModel.java

+3
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,9 @@ private UploadItem getUploadItem(UploadableFile uploadableFile,
142142
createdTimestampSource);
143143
if (place != null) {
144144
uploadItem.title.setTitleText(place.name);
145+
if(uploadItem.descriptions.isEmpty()) {
146+
uploadItem.descriptions.add(new Description());
147+
}
145148
uploadItem.descriptions.get(0).setDescriptionText(place.getLongDescription());
146149
uploadItem.descriptions.get(0).setLanguageCode("en");
147150
}

0 commit comments

Comments
 (0)