Commit a9b84b7a by Orkhan Alikhanov

Added error when there is no parent

parent 4e746a65
...@@ -658,6 +658,11 @@ private extension Layout { ...@@ -658,6 +658,11 @@ private extension Layout {
attributes.removeLast() attributes.removeLast()
anchor = LayoutAnchor(constraintable: nil, attributes: [.notAnAttribute]) anchor = LayoutAnchor(constraintable: nil, attributes: [.notAnAttribute])
} else { } else {
guard parent != nil else {
fatalError("[Material Error: Constraint requires view to have parent.")
}
anchor = LayoutAnchor(constraintable: parent, attributes: attributes) anchor = LayoutAnchor(constraintable: parent, attributes: attributes)
} }
return constraint(attributes, to: anchor, constants: constants) return constraint(attributes, to: anchor, constants: constants)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment