mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-26 12:23:58 +01:00
Fix crash for bookmarks without descriptions/thumbnails (#6488)
Some checks are pending
Android CI / Run tests and generate APK (push) Waiting to run
Some checks are pending
Android CI / Run tests and generate APK (push) Waiting to run
Co-authored-by: Nicolas Raoul <nicolas.raoul@gmail.com>
This commit is contained in:
parent
7a865df909
commit
7d96e94689
1 changed files with 7 additions and 13 deletions
|
|
@ -173,19 +173,13 @@ class BookmarkItemsDao @Inject constructor(
|
||||||
categoryNameList: List<String>,
|
categoryNameList: List<String>,
|
||||||
categoryDescriptionList: List<String>,
|
categoryDescriptionList: List<String>,
|
||||||
categoryThumbnailList: List<String>
|
categoryThumbnailList: List<String>
|
||||||
): List<CategoryItem> {
|
): List<CategoryItem> = categoryNameList.mapIndexed { index, name ->
|
||||||
return buildList {
|
|
||||||
for (i in categoryNameList.indices) {
|
|
||||||
add(
|
|
||||||
CategoryItem(
|
CategoryItem(
|
||||||
categoryNameList[i],
|
name = name,
|
||||||
categoryDescriptionList[i],
|
description = categoryDescriptionList.getOrNull(index),
|
||||||
categoryThumbnailList[i],
|
thumbnail = categoryThumbnailList.getOrNull(index),
|
||||||
false
|
isSelected = false
|
||||||
)
|
)
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue