From 6e3e1c0e52f7d2ec1a4053cb25b69e386a84b62d Mon Sep 17 00:00:00 2001 From: SynthesOne Date: Mon, 15 Jul 2024 17:25:45 +0500 Subject: [PATCH] crash fix iOS 15 --- Sources/General/UILayer/MPViewController.swift | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Sources/General/UILayer/MPViewController.swift b/Sources/General/UILayer/MPViewController.swift index 3c89640..7b53c8f 100644 --- a/Sources/General/UILayer/MPViewController.swift +++ b/Sources/General/UILayer/MPViewController.swift @@ -297,7 +297,7 @@ final class MPViewController: UIViewController { configuration.interSectionSpacing = UIScreenPixel let layout = UICollectionViewCompositionalLayout(sectionProvider: { [weak self] (sectionIndex: Int, environment: NSCollectionLayoutEnvironment) -> NSCollectionLayoutSection? in guard let strongSelf = self else { return nil } - let section = strongSelf.showedSections[sectionIndex] + let section = strongSelf.showedSections[optional: sectionIndex] var columnCount = 3 if UIApplication.shared.mp.scene?.interfaceOrientation.isLandscape == true { columnCount += 2 @@ -396,6 +396,9 @@ final class MPViewController: UIViewController { section.contentInsets = .zero return section + + default: + return nil } }, configuration: configuration)