title: Coroutine RoomDB NullPointerException
body: <p>I am getting a <code>NullPointerException</code> and <code>invokeSuspend</code> error when trying to get data from a Room DAO using a Kotlin coroutine. Do I need to do something special in order to use room and coroutines work together? The data that I'm querying definitely exists in the database.</p>
  <p><strong>The Error</strong></p>
  <pre><code>E/AndroidRuntime: FATAL EXCEPTION: DefaultDispatcher-worker-4
  Process: com.school, PID: 29799
  java.lang.NullPointerException:
  Attempt to invoke virtual method 'boolean java.lang.Boolean.booleanValue()' on a null object reference
      at com.school.Repository$fetchStudentInfo$1.invokeSuspend(Repository.kt:25)
      at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
      at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
      at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:571)
      at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750)
      at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:678)
      at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:665)
  </code></pre>
  <p><strong>The Presenter</strong></p>
  <pre><code>class Presenter(val view: View, val repository: Repository) {
      fun fetchStudentInfo() {
          repository.fetchStudentInfo(studentId)
      }
      fun displayStudentInfo(isGraduated: Boolean) {
          view.displayStudentInfo(isGraduated)
      }
  }
  </code></pre>
  <p><strong>The Repository</strong></p>
  <pre><code>class Repository(val roomdb: RoomDB, val presenter: Presenter) {
      fun fetchStudentInfo(studentId: Long) {
          CoroutineScope(IO).launch {
              val deferred = async { roomdb.studentDao().findById(studentId) }
              presenter.displayStudentInfo(deferred.await())
          }
      }
  }
  </code></pre>
  <p><strong>The DAO</strong></p>
  <pre><code>@Dao
  interface StudentDao {
      @Query(&quot;SELECT isGraduated FROM studentdata WHERE id = (:id)&quot;)
      suspend fun findById(id: String): Boolean
  }
  </code></pre>