diff --git a/Example/Diagnostics-Example/CustomSmartInsights.swift b/Example/Diagnostics-Example/CustomSmartInsights.swift index 96d52b9..c38d232 100644 --- a/Example/Diagnostics-Example/CustomSmartInsights.swift +++ b/Example/Diagnostics-Example/CustomSmartInsights.swift @@ -10,8 +10,8 @@ import Foundation import Diagnostics struct SmartInsightsProvider: SmartInsightsProviding { - func smartInsights(for chapter: DiagnosticsChapter) -> [SmartInsightProviding]? { - guard let html = chapter.diagnostics as? HTML else { return nil } + func smartInsights(for chapter: DiagnosticsChapter) -> [SmartInsightProviding] { + guard let html = chapter.diagnostics as? HTML else { return [] } if html.errorLogs.contains(where: { $0.contains("AppDelegate.ExampleLocalizedError") }) { return [ SmartInsight( @@ -20,6 +20,6 @@ struct SmartInsightsProvider: SmartInsightsProviding { ) ] } - return nil + return [] } } diff --git a/README.md b/README.md index 95b4e81..41aeaba 100644 --- a/README.md +++ b/README.md @@ -219,8 +219,8 @@ It's possible to provide your own custom insights based on the chapters in the r ```swift struct SmartInsightsProvider: SmartInsightsProviding { - func smartInsights(for chapter: DiagnosticsChapter) -> [SmartInsightProviding]? { - guard let html = chapter.diagnostics as? HTML else { return nil } + func smartInsights(for chapter: DiagnosticsChapter) -> [SmartInsightProviding] { + guard let html = chapter.diagnostics as? HTML else { return [] } if html.errorLogs.contains(where: { $0.contains("AppDelegate.ExampleLocalizedError") }) { return [ SmartInsight( @@ -229,7 +229,7 @@ struct SmartInsightsProvider: SmartInsightsProviding { ) ] } - return nil + return [] } } ```