'UIKitCore UICollectionViewFlowLayout invalidateLayoutWithContext crash in background iOS 15

Getting this crash in firebase crashlytics, seems to be iOS 15 only and when device is in background state:

Fatal Exception: NSInvalidArgumentException the invalidation context ((null)) sent to -[UICollectionViewFlowLayout invalidateLayoutWithContext:] is not an instance of type UICollectionViewFlowLayoutInvalidationContext or a subclass

My current theory is the collectionView is trying to update layout when in the background, but I'm unable to reproduce. Has anyone seem this or have any ideas? Thanks!

Update: I have a suspicion now this may be related to the iOS 15 'pre warming' feature? enter image description here



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source