From 4158cf0d9980d6b666f7736242423ac473c96800 Mon Sep 17 00:00:00 2001 From: Robert Payne Date: Mon, 16 Feb 2015 13:09:18 +1300 Subject: [PATCH] Further fix remake constraints crash in Swift 1.2 --- Snap/Constraint.swift | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Snap/Constraint.swift b/Snap/Constraint.swift index c9fa8ae..9a07b07 100644 --- a/Snap/Constraint.swift +++ b/Snap/Constraint.swift @@ -402,8 +402,10 @@ public class Constraint { if let view = self.installedOnView { // remove all installed layout constraints var layoutConstraintsToRemove = Array() - if let installedLayoutConstraints = self.installedLayoutConstraints?.allObjects as? Array { - layoutConstraintsToRemove += installedLayoutConstraints + if let allObjects = self.installedLayoutConstraints?.allObjects { + if let installedLayoutConstraints = allObjects as? Array { + layoutConstraintsToRemove += installedLayoutConstraints + } } if layoutConstraintsToRemove.count > 0 {