title: UIImagePickerController is throwing error
body: <p>I have following code to open the photo library or camera but whenever I run the code I get a runtime error: </p>
  
  <pre><code>WhatsUp[28458:10570522] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[__NSDictionaryM setObject:forKey:]: object cannot be nil (key: _UIImagePickerControllerMediaTypes)'
  *** First throw call stack:
  </code></pre>
  
  <p>Here is my code: </p>
  
  <pre><code> // open the camera
          self.imagePicker = UIImagePickerController(rootViewController: self)
          self.imagePicker.delegate = self
  
          if UIImagePickerController.isSourceTypeAvailable(.camera) {
              self.imagePicker.sourceType = .camera
  
          } else {
              self.imagePicker.sourceType = .photoLibrary
          }
  
          self.present(self.imagePicker, animated: true, completion: nil)
  </code></pre>
  
  <p>I have already added the privacy keys to the info.plist file as shown below: </p>
  
  <p><a href="https://i.stack.imgur.com/bCgqV.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/bCgqV.png" alt="enter image description here"></a></p>