What does "Fatal error: Unexpectedly found nil while unwrapping an Optional value" mean?
Asked 07 September, 2021
Viewed 1.8K times
  • 64
Votes

My Swift program is crashing with EXC_BAD_INSTRUCTION and one of the following similar errors. What does this error mean, and how do I fix it?


  

Fatal error: Unexpectedly found nil while unwrapping an Optional value

or


  

Fatal error: Unexpectedly found nil while implicitly unwrapping an Optional value


This post is intended to collect answers to "unexpectedly found nil" issues, so that they are not scattered and hard to find. Feel free to add your own answer or edit the existing wiki answer.

12 Answer