title: Kotlin: How to check variable with lateinit property is initialized or not
body: <p>I have a variable that is declared like</p>
  
  <pre><code>private lateinit var apiDisposable: Disposable
  </code></pre>
  
  <p>and then in <code>onPause()</code> method, I am doing</p>
  
  <pre><code>override fun onPause() {
      super.onPause()
      if (!apiDisposable.isDisposed)
          apiDisposable.dispose()
  }
  </code></pre>
  
  <p>But I get this </p>
  
  <blockquote>
    <p>kotlin.UninitializedPropertyAccessException: lateinit property
    apiDisposable has not been initialized</p>
  </blockquote>
  
  <p>Can anyone tell me how could I check if this variable is initialized or not? Is there any method like <code>isInitialised()</code></p>
  
  <p>Any help would be appreciated</p>