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 {