diff --git a/WordPress/Classes/ViewRelated/Stats/Insights/StatsTotalInsightsCell.swift b/WordPress/Classes/ViewRelated/Stats/Insights/StatsTotalInsightsCell.swift index e6f2d957712a..0713e3ab902e 100644 --- a/WordPress/Classes/ViewRelated/Stats/Insights/StatsTotalInsightsCell.swift +++ b/WordPress/Classes/ViewRelated/Stats/Insights/StatsTotalInsightsCell.swift @@ -269,6 +269,12 @@ class StatsTotalInsightsCell: StatsBaseCell { // Rebuilds guide view for accessibility only if guide view already exists private func rebuildGuideViewIfNeeded() { + /// NSAttributedString initialized with HTML on the background crashes the app + /// This method can be called when traitCollectionDidChange which can be triggered when app goes to background + guard UIApplication.shared.applicationState != .background else { + return + } + if guideText != nil, let statsSummaryType = statsSummaryType, let guideText = StatsTotalInsightsData.makeTotalInsightsGuideText(lastPostInsight: lastPostInsight, statsSummaryType: statsSummaryType) {