mzeeshanid / MZDownloadManager

This download manager uses NSURLSession api to download files. It can download multiple files at a time. It can download large files if app is in background. It can resume downloads if app was quit.
BSD 3-Clause "New" or "Revised" License
1.12k stars 238 forks source link

Divide By Zero Exception #90

Open JonathanWilson1 opened 4 years ago

JonathanWilson1 commented 4 years ago

Line 188 in MZDownloadManager.swift

In my case the casting of 0.8359183 to an Int64 produces 0 which then shows Fatal error: Division by zero

I think there is room for improving this code by cleaning up all the casting, but maybe a simple speed > 0 check is enough?