title: How to check if array contain null value and give default value swift
body: <p>I have an array that's populated from a JSON response from an API server. Sometimes the values for a key in this array are Null</p>
  
  <p>I am trying to take the given value and drop it into the detail text of a table cell for display.</p>
  
  <p>The problem is that when I try to coerce the value into an String I get a crash, which I think is because I'm trying to coerce Null into a string.</p>
  
  <p>What's the right way to do this?
  ex-
  my response is below type and I'm trying to fetch that array in self.imageArray variable</p>
  
  <p>response = ["abc.jpg","null","xyzzy.jpg"]</p>
  
  <pre><code> self.imageArray = (self.dataArray.value(forKey: "product_image") as? [String])!
  </code></pre>
  
  <p>but at second iteration it gets crashed coz second value is null.</p>