title: Weird fatal error: unexpectedly found nil while unwrapping an Optional value
body: <p>I'm using sqlite for my iOS Swift app. Below is an error snippet when I select a row from database. </p>
  
  <p>The problem is: It has a value but it generate a fatal error. (unexpectedly found nil while unwrapping an Optional value)</p>
  
  <p><a href="https://i.stack.imgur.com/pGWyC.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/pGWyC.png" alt="enter image description here"></a></p>
  
  <p>The library I used is: <a href="https://github.com/stephencelis/SQLite.swift" rel="nofollow noreferrer">stephencelis/SQLite.swift</a></p>
  
  <pre><code>import Foundation
  import SQLite
  
  struct studentDB {
      let table = Table("students")
      let code = Expression&lt;String&gt;("code")
      let name = Expression&lt;String&gt;("name")
      let gender = Expression&lt;Int&gt;("gender")
      let birth = Expression&lt;String&gt;("birth")
      let born = Expression&lt;String&gt;("born")
      let className = Expression&lt;String&gt;("class")
      let speciality = Expression&lt;String&gt;("speciality")
      let department = Expression&lt;String&gt;("department")
      let faculty = Expression&lt;String&gt;("faculty")
      let training = Expression&lt;String&gt;("training")
      let course = Expression&lt;String&gt;("course")
      let advisor = Expression&lt;String&gt;("advisor")
  }
  
  struct student {
      let code: String!
      let name: String?
      let gender: Int?
      let birth: String?
      let born: String?
      let className: String?
      let speciality: String?
      let department: String?
      let faculty: String?
      let training: String?
      let course: String?
      let advisor: String?
  }
  
  class Student {
      class func getStudent(code: String) -&gt; student? {
          let studentDBInfo = studentDB()
          let studentRaw = try! userDatabase.pluck(studentDBInfo.table.filter(studentDBInfo.code == code))
          if (studentRaw != nil) {
              let studentInfo = student(
                  code: studentRaw![studentDBInfo.code],
                  name: studentRaw![studentDBInfo.name],
                  gender: studentRaw![studentDBInfo.gender],
                  birth: studentRaw![studentDBInfo.birth],
                  born: studentRaw![studentDBInfo.born],
                  className: studentRaw![studentDBInfo.className],
                  speciality: studentRaw![studentDBInfo.speciality],
                  department: studentRaw![studentDBInfo.department],
                  faculty: studentRaw![studentDBInfo.faculty],
                  training: studentRaw![studentDBInfo.training],
                  course: studentRaw![studentDBInfo.course],
                  advisor: studentRaw![studentDBInfo.advisor]
              )
              return studentInfo
          } else {
              return nil
          }
      }
  }
  </code></pre>
  
  <p>All other column work fine.
  To be more clear:</p>
  
  <pre><code>print(studentRaw![studentDBInfo.code]) -&gt; crash 
  print(studentRaw![studentDBInfo.name]) -&gt; "Pham Tuan Anh"
  </code></pre>