Skip to content

[__NSArrayM insertObject:atIndex:]: object cannot be nil #289

Description

@iqraKhaliq

Description
The app crashes on iOS with the following error message:
[__NSArrayM insertObject:atIndex:]: object cannot be nil

Expected Behavior
The app should handle null or undefined objects gracefully and not attempt to insert a nil object into an array.

Actual Behavior
When repeatedly moving between screens (e.g., navigating forward and then back), the app eventually crashes with the error above.

Environment
Platform: iOS
React Native Version: 0.80.2
iOS Version: iOS 18.3
Device: iPhone 16 Pro Simulator
Package version: 3.4.2

Steps to Reproduce

  • Launch the app on an iOS device or simulator.
  • Navigate from Screen A → Screen B.
  • Go back to Screen A.
  • Repeat the process a few times.

Observe that the app crashes with the message:
[__NSArrayM insertObject:atIndex:]: object cannot be nil

Crash Log / Stack Trace
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[__NSArrayM insertObject:atIndex:]: object cannot be nil'

Crash Video Link
https://drive.google.com/file/d/1orGmmZmEBDKJZhNSpQWhd1QLsAPN1F7Q/view?usp=sharing

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions