Skip to content

Commit

Permalink
Merge pull request #637 from Infomaniak/NPE-in-getCategories-from-Pre…
Browse files Browse the repository at this point in the history
…viewSlider

Fixed NPE in PreviewSlider when getting categories
  • Loading branch information
sirambd authored Mar 11, 2022
2 parents c0bf0ac + 3c95c2d commit 41317e8
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ object FileController {
fun getPicturesDrive(customRealm: Realm? = null): ArrayList<File> {
val operation: (Realm) -> ArrayList<File> = { realm ->
realm.where(File::class.java).equalTo(File::id.name, PICTURES_FILE_ID).findFirst()?.let { picturesFolder ->
realm.copyFromRealm(picturesFolder.children, 0) as ArrayList<File>
realm.copyFromRealm(picturesFolder.children, 1) as ArrayList<File>
} ?: arrayListOf()
}
return customRealm?.let(operation) ?: getRealmInstance().use(operation)
Expand Down

0 comments on commit 41317e8

Please sign in to comment.