Authored by shunzi

为masonry添加保护

1 Pod::Spec.new do |s| 1 Pod::Spec.new do |s|
2 s.name = 'Masonry' 2 s.name = 'Masonry'
3 - s.version = '1.1.0' 3 + s.version = '1.1.0.yoho'
4 s.license = 'MIT' 4 s.license = 'MIT'
5 s.summary = 'Harness the power of Auto Layout NSLayoutConstraints with a simplified, chainable and expressive syntax.' 5 s.summary = 'Harness the power of Auto Layout NSLayoutConstraints with a simplified, chainable and expressive syntax.'
6 s.homepage = 'https://github.com/cloudkite/Masonry' 6 s.homepage = 'https://github.com/cloudkite/Masonry'
@@ -327,6 +327,12 @@ static char kInstalledConstraintsKey; @@ -327,6 +327,12 @@ static char kInstalledConstraintsKey;
327 if (!self.firstViewAttribute.isSizeAttribute && !self.secondViewAttribute) { 327 if (!self.firstViewAttribute.isSizeAttribute && !self.secondViewAttribute) {
328 secondLayoutItem = self.firstViewAttribute.view.superview; 328 secondLayoutItem = self.firstViewAttribute.view.superview;
329 secondLayoutAttribute = firstLayoutAttribute; 329 secondLayoutAttribute = firstLayoutAttribute;
  330 +
  331 + if (!secondLayoutItem) {
  332 + NSAssert(secondLayoutItem, @"YH_Mall : The secondItem is null or nil !!!!!");
  333 + return;
  334 + }
  335 +
330 } 336 }
331 337
332 MASLayoutConstraint *layoutConstraint 338 MASLayoutConstraint *layoutConstraint