Browse Source

容错判断

jsonwang 3 years ago
parent
commit
3bbcfdcdd5
1 changed files with 7 additions and 0 deletions
  1. 7 0
      BFFramework/Classes/PQGPUImage/akfilters/PQTextFilter.swift

+ 7 - 0
BFFramework/Classes/PQGPUImage/akfilters/PQTextFilter.swift

@@ -28,8 +28,11 @@ open class PQTextFilter: PQBaseFilter {
         super.init(fragmentShader: AlphaPassthroughFragmentShader, numberOfInputs: 1)
         stickerInfo = sticker
         subTitleTexture = 0
+        
+//        BFLog("\(stickerInfo.materialPosition)", message: 2)
  
         createTexture()
+        
     }
  
     // 清空数据
@@ -46,6 +49,10 @@ open class PQTextFilter: PQBaseFilter {
         DispatchQueue.main.async {[weak self] in
  
             autoreleasepool {
+                if(self == nil){
+                    BFLog(message: "self is null error!!!!!")
+                    return
+                }
                 let subtitleLab =
                 UILabel.init(frame: CGRect(x: 0, y: 0, width: self?.stickerInfo?.materialPosition?.width ?? 0, height: self?.stickerInfo?.materialPosition?.height ?? 0))