Fix crash on nil image.

The only case I've actuall seen this is when a download is removed from
the file system, outside of Signal.

// FREEBIE
pull/1/head
Michael Kirk 9 years ago
parent 82c903b5da
commit 21d37a92e5

@ -46,10 +46,18 @@
+ (double)clamp:(double)value toMin:(double)min andMax:(double)max { + (double)clamp:(double)value toMin:(double)min andMax:(double)max {
ows_require(min <= max); ows_require(min <= max);
if (value < min) if (isnan(value)) {
return max;
}
if (value < min) {
return min; return min;
if (value > max) }
if (value > max) {
return max; return max;
}
return value; return value;
} }

Loading…
Cancel
Save