IGListKit icon indicating copy to clipboard operation
IGListKit copied to clipboard

Crash Fatal Exception: NSInvalidArgumentException *** -[__NSDictionaryM setObject:forKeyedSubscript:]: key cannot be nil

Open xiongcai opened this issue 1 year ago • 1 comments

New issue checklist

  • [x] I have reviewed the README and documentation
  • [x] I have searched existing issues and this is not a duplicate
  • [x] I have attempted to reproduce the issue and include an example project.

General information

  • IGListKit version:
  • iOS version(s): iOS 12.5.7
  • Xcode version: Xcode 15.2
  • Devices/Simulators affected:on iphone 6
  • Reproducible in the demo project? (Yes/No):YES
  • Related issues: Firbase log: image

after i add an element, i called update, it crash on iphone6,but not on other iphone, the indexPath is nil, i do not know why? [self.adapter performUpdatesAnimated:YES completion:nil];

Debug information

image

# Please include debug logs using the following lldb command:
# Please include debug logs using the following lldb command:

(lldb) po [IGListDebugger dump]
IGListAdapter 0x2811722f0:
  Updater type: IGListAdapterUpdater
  Data source: <WPVFCommentViewController: 0x14bc1e860>
  Collection view delegate: (null)
  Scroll view delegate: (null)
  Is in update block: No
  View controller: <WPVFCommentViewController: 0x14bc1e860>
  Is prefetching enabled: No
  Registered cell identifiers:
  {(
    WPVFCommentFirstCell
)}
  Registered supplementary view identifiers:
  {(
    UICollectionElementKindSectionHeaderWPVFCommentReusableView
)}
  IGListAdapterUpdater instance 0x2801f0700:
    Moves as deletes+inserts: No
    Allows background reloading: Yes
    Has queued reload data: No
    Queued update is animated: Yes
    State: Executed batch update block
    Batch update data:
      Insert sections: <_NSCachedIndexSet: 0x282a70080>[number of indexes: 1 (in 1 ranges), indexes: (0)]
      Delete sections: <_NSCachedIndexSet: 0x282ac7d20>(no indexes)
  Section map details:
    IGListBindingSectionController 0x28135e5a0:
  Data source: <WPVFCommentSectionController: 0x28135e5a0>
  Selection delegate: <WPVFCommentSectionController: 0x28135e5a0>
  Object: <WPCommentInfo: 0x126bf1b70>
  View models:
  <WPCommentInfo: 0x126bf1b70>: 15407
  Number of items: 1
  View controller: <WPVFCommentViewController: 0x14bc1e860>
  Collection context: <IGListAdapter: 0x2811722f0>
  Section: 0
  Is first section: Yes
  Is last section: No
  Supplementary view source: <WPVFCommentSectionController: 0x28135e5a0>
  Display delegate: (null)
  Working range delegate: (null)
  Scroll delegate: (null)
    IGListBindingSectionController 0x281365b20:
  Data source: <WPVFCommentSectionController: 0x281365b20>
  Selection delegate: <WPVFCommentSectionController: 0x281365b20>
  Object: <WPCommentInfo: 0x13f3856e0>
  View models:
  <WPCommentInfo: 0x13f3856e0>: 15406
  Number of items: 1
  View controller: <WPVFCommentViewController: 0x14bc1e860>
  Collection context: <IGListAdapter: 0x2811722f0>
  Section: 1  Is first section: No
  Is last section: Yes
  Supplementary view source: <WPVFCommentSectionController: 0x281365b20>
  Display delegate: (null)
  Working range delegate: (null)
  Scroll delegate: (null)
  Previous section map details:
    IGListBindingSectionController 0x281365b20:
  Data source: <WPVFCommentSectionController: 0x281365b20>
  Selection delegate: <WPVFCommentSectionController: 0x281365b20>
  Object: <WPCommentInfo: 0x13f3856e0>
  View models:
  <WPCommentInfo: 0x13f3856e0>: 15406
  Number of items: 1
  View controller: <WPVFCommentViewController: 0x14bc1e860>
  Collection context: <IGListAdapter: 0x2811722f0>
  Section: 1
  Is first section: No
  Is last section: Yes
  Supplementary view source: <WPVFCommentSectionController: 0x281365b20>
  Display delegate: (null)
  Working range delegate: (null)
  Scroll delegate: (null)
  Collection view details:
    Class: IGListCollectionView, instance: 0x127a59800
    Data source: <IGListAdapter: 0x2811722f0>
    Delegate: <IGListAdapter: 0x2811722f0>
    Layout: <IGListCollectionViewLayout: 0x126bdcd00>
    Frame: {{0, 81}, {375, 314}}, bounds: {{0, 0}, {375, 314}}
    Number of sections: 2
      1 items in section 0
      1 items in section 1
    Visible cell details:
      Visible cell at section 0, item 0:
      <WPVFCommentFirstCell: 0x14bc879b0; baseClass = UICollectionViewCell; frame = (0 40; 375 96); layer = <CALayer: 0x282c34ea0>>

xiongcai avatar Oct 31 '24 11:10 xiongcai

Hmm, that is certainly an interesting crash! Sorry to hear you're having trouble here @xiongcai!

Are you still having this issue? If so, can you please go one step higher in the stack trace and see if the UICollectionView delegate itself is reporting nil for the indexPath value?

TimOliver avatar May 01 '25 08:05 TimOliver