title: Exception throw for null data with optional Int type in Realm
body: <p>I am taking my first foray into using Realm (0.98.1 via Cocoapods, Xcode 7.2) and am running into a small problem that I am not sure how to solve. </p>
  
  <p>I have a model class called Airport that declares a property</p>
  
  <p><code>let elevationFt = RealmOptional&lt;Int&gt;()</code></p>
  
  <p>I am creating a set of Airport objects and persisting them in the following way</p>
  
  <pre><code>public func cacheDataToPersistanceStore(data:NSArray) -&gt; Bool {
      var success = true
      autoreleasepool {
          do {
              let realm = try Realm()
              realm.beginWrite()
              for object in data {
                  guard let dictionaryValues = object as? Dictionary&lt;String, AnyObject&gt; else {
                      debugPrint("Unable to convert data to correct type")
                      success = false
                      return
                  }
                  if(dictionaryValues["airportID"] as! Int == 6605) {
                      realm.create(Airport.self, value: dictionaryValues, update: true)
                  }
  
              }
  
              try realm.commitWrite()
          }
          catch(let e) {
              debugPrint(e)
              success = false
          }
      }
  
      return success
  
  }
  </code></pre>
  
  <p>For the airport entry in question, the dictionary that stores the relevant data looks to have a null value for the key "elevationFt", so I assume things will be OK for the optional Int property</p>
  
  <p><a href="https://i.stack.imgur.com/fLwWB.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/fLwWB.png" alt="Image of debug view for dictionary"></a></p>
  
  <p>Here is a string version of the dictionary: </p>
  
  <p>["gps_code": 01MD, "ident": 01MD, "iata_code": , "local_code": 01MD, "keywords": , "elevationFt": , "type": seaplane_base, "municipality": Annapolis, "iso_country": US, "airportID": 6605, "longitudeDeg": -76.45600128173828, "latitudeDeg": 38.99919891357422, "iso_region": US-MD, "wikipedia_link": , "name": Annapolis Seaplane Base, "scheduled_service": no, "continent": NA, "home_link": ]</p>
  
  <p>However once the create function starts for this set of data, an exception is thrown:</p>
  
  <pre><code>Terminating app due to uncaught exception 'RLMException', reason: 'Invalid value '' for property 'elevationFt''
  </code></pre>
  
  <p>I am guessing I have something set up incorrectly, but I am not quite sure how to fix this other than to clean my source data for that particular field.</p>