What happened
App crashes when dragging the bottom edge of the crop guide. CGRect.intersection() in updateMaximumRect() returns CGRect.null (all coordinates are inf), and those get set as NSLayoutConstraint.constant — which throws NSInternalInconsistencyException.
Stack trace (key frames)
Fatal Exception: NSInternalInconsistencyException
3 CoreAutoLayout -[NSLayoutConstraint _setSymbolicConstant:constant:symbolicConstantMultiplier:]
4 CoreAutoLayout -[NSLayoutConstraint setConstant:]
5 Pikgeon CropView._InteractiveCropGuideView.onGestureTrackingChanged() + 372
6 Pikgeon CropView._InteractiveCropGuideView.handlePanGestureInBottom(gesture:) + 947
Where
CropView._InteractiveCropGuideView.swift, updateMaximumRect():
let r = self.frame
.inset(by: reversedInsets)
.intersection(containerView.bounds.inset(by: insetOfGuideFlexibility))
maximumRect = r
leftMaxConstraint?.constant = r.minX // inf when r is .null
rightMaxConstraint?.constant = maximumRect!.maxX - superview!.bounds.maxX
topMaxConstraint?.constant = r.minY
bottomMaxConstraint?.constant = maximumRect!.maxY - superview!.bounds.maxY
When the expanded guide frame and the container bounds don't overlap (can happen during fast panning), intersection() returns CGRect.null. Its coordinates are all inf, and Auto Layout rejects infinite constraint constants.
The four activate*MaxConstraint() methods also force-unwrap maximumRect! and superview!, which would crash if maximumRect is still nil (e.g. null intersection on the very first .began call).
Reproduce
Hard to reproduce on demand — it happens during fast/aggressive dragging of the crop guide edge. Showed up in Crashlytics from a real user session.
Environment
- Brightroom 3.2.0
- iOS 18
- iPhone (arm64)
What happened
App crashes when dragging the bottom edge of the crop guide.
CGRect.intersection()inupdateMaximumRect()returnsCGRect.null(all coordinates areinf), and those get set asNSLayoutConstraint.constant— which throwsNSInternalInconsistencyException.Stack trace (key frames)
Where
CropView._InteractiveCropGuideView.swift,updateMaximumRect():When the expanded guide frame and the container bounds don't overlap (can happen during fast panning),
intersection()returnsCGRect.null. Its coordinates are allinf, and Auto Layout rejects infinite constraint constants.The four
activate*MaxConstraint()methods also force-unwrapmaximumRect!andsuperview!, which would crash ifmaximumRectis stillnil(e.g. null intersection on the very first.begancall).Reproduce
Hard to reproduce on demand — it happens during fast/aggressive dragging of the crop guide edge. Showed up in Crashlytics from a real user session.
Environment