浏览代码

【会员系统 】AI使用功能崩溃问题

dinglingui 1 周之前
父节点
当前提交
a76bf66316
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      PDF Office/PDF Master/Class/AIInfo/KMAIRequestServerManager.swift

+ 1 - 1
PDF Office/PDF Master/Class/AIInfo/KMAIRequestServerManager.swift

@@ -879,7 +879,7 @@ class KMAIRequestServer {
            }
            }
             let jsonObject = try? JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary ?? [:]
             let jsonObject = try? JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary ?? [:]
             if jsonObject != nil {
             if jsonObject != nil {
-                let codeStr: String = jsonObject!["code"] as! String
+                let codeStr: String = jsonObject!["code"] as? String ?? ""
                 var code: Int = 0
                 var code: Int = 0
                 if let numCode = Int(codeStr) {
                 if let numCode = Int(codeStr) {
                     code = numCode
                     code = numCode