From 46d8a8173985ee90d251e78af21d1b0262f6e671 Mon Sep 17 00:00:00 2001 From: Aurelius Prochazka Date: Mon, 3 Sep 2018 00:58:09 -0700 Subject: [PATCH] Avoid force unwrapping of the initial touch index --- Source/views/MacawView.swift | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Source/views/MacawView.swift b/Source/views/MacawView.swift index f3c9d716..94a43df3 100644 --- a/Source/views/MacawView.swift +++ b/Source/views/MacawView.swift @@ -296,7 +296,9 @@ open class MacawView: MView, MGestureRecognizerDelegate { var points = [TouchPoint]() for initialTouch in initialTouches { - let currentIndex = touches.index(of: initialTouch)! + guard let currentIndex = touches.index(of: initialTouch) else { + continue + } let currentTouch = touches[currentIndex] let location = CGPoint(x: currentTouch.x, y: currentTouch.y) let inverted = currentNode.place.invert()!