I had this issue happening to me yesterday. I was dealing with a piece of production code that was crashing at a certain point with this crash info 

```none
0   Goga  0x00000001000b90b8 function signature specialization <Arg[0] = Owned To Guaranteed, Arg[1] = Owned To Guaranteed> of Goga.NewViewController.emailButtonPressed (Goga.NewViewController)(ObjectiveC.UIButton) -> () (NewViewController.swift:0)
1   Goga  0x00000001000c0488 Goga.NewViewController.(emailButtonPressed (Goga.NewViewController) -> (ObjectiveC.UIButton) -> ()).(closure #2) (NewViewController.swift:872)
2   Goga  0x00000001000bd250 partial apply forwarder for reabstraction thunk helper from @callee_owned (@in ObjectiveC.UIAlertAction!) -> (@out ()) to @callee_owned (@owned ObjectiveC.UIAlertAction!) -> (@unowned ()) (NewViewController.swift:0)

```

However, when I found the bug, after hours of trying to replicate the issue, any error message for it couldn't be found in the crash log. The bug was showing in XCode instead as: 

> 
> unexpectedly found nil while unwrapping an Optional value
> 
> 
> 

My question is, how to catch the nil-optional error in production code?

**Edit:**

Just to add a bit more of a perspective to the original problem, I found the issue in this sample code:

```
let cell = tableView.cellForRowAtIndexPath(indexPath)  
cell.textLabel.text = "Hello" // CRASH if the cell is not visible in the view

```

I should have done this instead:

```
if let cell = tableView.cellForRowAtIndexPath(indexPath) {
  cell.textLabel.text = "Hello" // Never get executed if cell is nil
} 

```