Fix crash when ReportView opened before instance loaded
This commit is contained in:
parent
daf3741c9a
commit
76550d8fb8
|
@ -23,7 +23,7 @@ struct ReportView: View {
|
||||||
self.account = mastodonController.persistentContainer.account(for: report.accountID)!
|
self.account = mastodonController.persistentContainer.account(for: report.accountID)!
|
||||||
self.mastodonController = mastodonController
|
self.mastodonController = mastodonController
|
||||||
self._report = StateObject(wrappedValue: report)
|
self._report = StateObject(wrappedValue: report)
|
||||||
if mastodonController.instance.rules == nil {
|
if mastodonController.instance?.rules == nil {
|
||||||
report.reason = .spam
|
report.reason = .spam
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -77,7 +77,7 @@ struct ReportView: View {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if mastodonController.instance.rules != nil {
|
if mastodonController.instance?.rules != nil {
|
||||||
NavigationLink {
|
NavigationLink {
|
||||||
ReportSelectRulesView(mastodonController: mastodonController, report: report)
|
ReportSelectRulesView(mastodonController: mastodonController, report: report)
|
||||||
} label: {
|
} label: {
|
||||||
|
|
Loading…
Reference in New Issue