title: Why does NSPredicate with block fail when evaluating nil?
body: <p>I discovered this when debugging a crash with <code>NSPredicate</code>. It seems like it does not check for nil values properly.</p>
  
  <pre><code>let blockPredicate = NSPredicate(block: { (object, _) -&gt; Bool in
      guard let object = object as? String else {
          return false
      }
      return true
  })
  
  blockPredicate.evaluateWithObject("Hello")  // true
  blockPredicate.evaluateWithObject(nil)      // EXEC_BAD_ACCESS (code=1,address=0x0)
  </code></pre>
  
  <p>The documentation states this should work.</p>
  
  <pre><code>public init(block: (AnyObject, [String : AnyObject]?) -&gt; Bool)
  public func evaluateWithObject(object: AnyObject?) -&gt; Bool // evaluate a predicate against a single object
  </code></pre>
  
  <p>The block should receive a proper <code>AnyObject</code> but instead a <code>nil</code> pointer <code>0x0</code> is passed in. It's not possible to check for <code>nil</code> with <code>if let object = object</code> or <code>object != nil</code> because the compiler will not accept it.</p>
  
  <p>Is this a bug or am I reading this wrong?</p>