Open mathist opened 3 years ago
if let m = chat.message , let font = UIFont(name: "Lato-Regular", size: 20.0) { let markdownParser = CDMarkdownParser(font: font) }
No crash
Crash in CDFont+CDMarkdownKit.swift, line 57. Unexpectedly found nil when unwrapping optional value.
CDMarkdownKit v2.1.1 xcode 12.5.1 swift v5.0 iOS Simulator macOS 11.4
This is the CDMarkdownKit code that crashed, it crashed on the force unwrap of "descriptor" variable.
private func withTraits(_ traits: CDFontDescriptorSymbolicTraits...) -> CDFont { let descriptor = fontDescriptor.withSymbolicTraits(CDFontDescriptorSymbolicTraits(traits)) return CDFont(descriptor: descriptor!, size: self.pointSize) }
Thanks for pointing this out @mathist . I'll take a look
Still crashing on this line.
let parser = CDMarkdownParser(font: textFont, backgroundColor: UIColor.clear)
What did you do?
What did you expect to happen?
No crash
What happened instead?
Crash in CDFont+CDMarkdownKit.swift, line 57. Unexpectedly found nil when unwrapping optional value.
CDMarkdownKit Environment
CDMarkdownKit v2.1.1 xcode 12.5.1 swift v5.0 iOS Simulator macOS 11.4
This is the CDMarkdownKit code that crashed, it crashed on the force unwrap of "descriptor" variable.