Skip to content

Commit

Permalink
Fix name is null issue (#81)
Browse files Browse the repository at this point in the history
  • Loading branch information
kinnerapriyap authored Nov 4, 2020
1 parent 43123cf commit e71fefd
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -126,12 +126,13 @@ class ShergilViewModel(application: Application) : AndroidViewModel(application)
val bucketColumnIndex = cursor.getColumnIndex(MediaGalleryHandler.BUCKET_DISPLAY_NAME)
if (bucketColumnIndex == -1) break
val name = cursor.getString(bucketColumnIndex)
if (!addedNamesCount.contains(name)) {
cursor.moveToNext()
if (name == null) continue
else if (!addedNamesCount.contains(name)) {
addedNamesCount[name] = 1
} else {
addedNamesCount[name] = (addedNamesCount[name] ?: 0) + 1
}
cursor.moveToNext()
}
addedNamesCount[ALL_ALBUM_BUCKET_DISPLAY_NAME] = cursor.count
if (choiceSpec.allowCamera) {
Expand Down

0 comments on commit e71fefd

Please sign in to comment.