From 7d3e24c6b9d54b0068a2b05aa7bd6bef40222677 Mon Sep 17 00:00:00 2001 From: Mohamed Afifi Date: Sun, 15 Oct 2023 11:15:22 -0400 Subject: [PATCH] Fix crash when changing translations from TranslatedVerse screen (#565) --- Features/QuranViewFeature/QuranViewController.swift | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Features/QuranViewFeature/QuranViewController.swift b/Features/QuranViewFeature/QuranViewController.swift index 3c3c8158..ce6478de 100644 --- a/Features/QuranViewFeature/QuranViewController.swift +++ b/Features/QuranViewFeature/QuranViewController.swift @@ -349,6 +349,11 @@ class QuranViewController: BaseViewController, QuranViewDelegate, } private func updateTitle(_ pages: [Page]) { + if pages.isEmpty { + titleView?.firstLine = "" + titleView?.secondLine = "" + return + } let suras = pages.map(\.startSura) let juzs = pages.map(\.startJuz) let pageNumbers = pages.map(\.pageNumber).map(NumberFormatter.shared.format).joined(separator: " - ")