Handle nil better

This commit is contained in:
Garth Vander Houwen 2023-08-10 12:04:16 -07:00
parent 8f3d3998ea
commit 68854dee50

View file

@ -206,7 +206,7 @@ struct EnvironmentMetricsLog: View {
isPresented: $isExporting,
document: CsvDocument(emptyCsv: exportString),
contentType: .commaSeparatedText,
defaultFilename: String("\(node.user!.longName ?? "Node") Environment Metrics Log"),
defaultFilename: String("\(node.user?.longName ?? "Node") Environment Metrics Log"),
onCompletion: { result in
if case .success = result {
print("Environment metrics log download succeeded.")