googlearchive / science-journal-ios

Use the sensors in your mobile devices to perform science experiments. Science doesn’t just happen in the classroom or lab—tools like Science Journal let you see how the world works with just your phone.
https://sciencejournal.withgoogle.com/
Apache License 2.0
536 stars 62 forks source link

Int() can overflow, use fail-able initializer #30

Closed taquitos closed 5 years ago

taquitos commented 5 years ago

We have a couple crashes around anomalous data. We've been able to track it down to attempting to create an Int out of a Double that is too big to fit in an Int.

Checklist

Description

Updated most places where Ints can overflow by using Int(exactly which is a fail-able initializer.