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

Index out of range #40

Open
AnasMostefaoui opened this issue May 8, 2017 · 0 comments
Open

Index out of range #40

AnasMostefaoui opened this issue May 8, 2017 · 0 comments

Comments

@AnasMostefaoui
Copy link

AnasMostefaoui commented May 8, 2017

Hello

Trying to download 2 objects at the same time, an out of range exception is thrown caused by this line : 208 :
self.downloadingArray[index] = downloadModel

file : MZDownloadManager.swift

look likes a race condition, since the object may be removed befor the code above is executed, which lead to that exception.

to fix this issue, I changed to previous line with the following :

 if self.downloadingArray.contains(downloadModel), let objectIndex = self.downloadingArray.index(of: downloadModel) {

                        self.downloadingArray[objectIndex] = downloadModel

                    }
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

No branches or pull requests

1 participant