ibireme 9 년 전
부모
커밋
944fedf816
1개의 변경된 파일1개의 추가작업 그리고 0개의 파일을 삭제
  1. 1 0
      YYText/Component/YYTextLayout.m

+ 1 - 0
YYText/Component/YYTextLayout.m

@@ -418,6 +418,7 @@ dispatch_semaphore_signal(_lock);
     
     // set cgPath and cgPathBox
     if (container.path == nil && container.exclusionPaths.count == 0) {
+        if (container.size.width <= 0 || container.size.height <= 0) goto fail;
         CGRect rect = (CGRect) {CGPointZero, container.size };
         rect = UIEdgeInsetsInsetRect(rect, container.insets);
         rect = CGRectStandardize(rect);