什么是 swift 中的闭包 #1 错误?

use*_*030 5 error-handling ios swift

我在调试此错误时遇到问题。我在我的 iOS 应用程序上使用 Crashlytics,并且在我的一些应用程序中看到了这个错误。这是堆栈跟踪的一部分:

在此处输入图片说明

这是我在 BusStopTimesViewController.swift 中的代码(我评论了第 140 行,因为根据跟踪,这似乎是问题发生的地方):

func loadBusData(_ busUrl: String) {
    let urlString = busUrl
    let url = URL(string: urlString)!

    ...

    if passingTimePredicted != "" {
        let nextBusDate = dateFormatter.date(from: passingTimePredicted)

        // THE FOLLOWING LINE IS LINE 140
        var minutesUntilBus = (nextBusDate!.timeIntervalSince1970 - Date().timeIntervalSince1970) / 60

        let calendar = Calendar.current
        let hour = calendar.component(.hour, from: nextBusDate!)
        let minutes = calendar.component(.minute, from: nextBusDate!)

        ...
    }
}
Run Code Online (Sandbox Code Playgroud)

我最初的想法是因为 nextBusDate 是 nil 并且我正在尝试使用它,但我不认为那是因为错误没有说明 nextBusDate 为零(尽管我可能应该在使用之前检查它是否为零它)。我对这个错误(关闭#1)是什么感到困惑?任何想法将不胜感激。