Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix changing albums crash #747

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

Eslam-Salem
Copy link
Contributor

steps to reproduce:
you have 2 albums in you gallery (recents album (has 30 media items), screenshots album (has 9 media items))
note that (screenshots album) has the screenshots images in (recents album)

  • open albums with many photos and videos (recents album).
  • select more than 9 media items from resects album for example select 15 media items.
  • go to album screenshots
  • deselect last item selected

app will crash because reload items for selectedIndexPaths will reload 15 indexpath while screenshots albums collection view has only 9 indexpaths.

what i do:
change selectedIndexPaths variable to be have only 9 cells.

@@ -53,6 +53,16 @@ extension YPLibraryVC {
}

// MARK: - Library collection view cell managing
private func getSelectedIndexPaths(selectedItems: [YPLibrarySelection]) -> [IndexPath] {
let collectionViewItemsCount = v.collectionView.numberOfItems(inSection: 0)
var SelectedIndexPaths = [IndexPath]()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

vars don't called uppercased in swift

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry for the typo. it is updated it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants