We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0704c13 commit ce7dbceCopy full SHA for ce7dbce
PhoneNumberKit/PhoneNumberKit.swift
@@ -327,8 +327,14 @@ public final class PhoneNumberKit: NSObject {
327
guard let jsonPath = frameworkBundle.path(forResource: "PhoneNumberMetadata", ofType: "json") else {
328
throw PhoneNumberError.metadataNotFound
329
}
330
- let data = try Data(contentsOf: URL(fileURLWithPath: jsonPath))
331
- return data
+// let data = try Data(contentsOf: URL(fileURLWithPath: jsonPath))
+// return data
332
+ if let nsData = NSData(contentsOfFile: jsonPath) {
333
+ let data = Data(referencing: nsData)
334
+ return data
335
+ } else {
336
+ throw PhoneNumberError.metadataNotFound
337
+ }
338
339
340
0 commit comments