title: Kotlin Android Studio - Only safe (?.) or non-null asserted (!!.) calls are allowed on a nullable receiver of type Intent?
body: <p>I am getting this error code while going through Android Studio 3.0 Development Essentials. "Only safe (?.) or non-null asserted (!!.) calls are allowed on a nullable receiver of type Intent?". Not sure why. The above code is what I am currently working with and "Intent" had automatically generated a question mark. The bottom code is what is shown in the book.      </p>
  
  <pre><code>override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
      if ((requestCode == request_code) &amp;&amp; (resultCode == Activity.RESULT_OK)) {
          if (data.hasExtra("returnData")) {
              val returnString = data.extras.getString("returnData")
              textView1.text = returnString
          }
      }
  }
  </code></pre>
  
  <p><strong>Code in book</strong></p>
  
  <pre><code>override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent) {
      if ((requestCode == request_code) &amp;&amp; (resultCode == RESULT_OK)) {
          if (data.hasExtra("returnData")) {
              val returnString = data.extras.getString("returnData")
              textView1.text = returnString
          }
      }
  }
  </code></pre>