title: Kotlin Null pointer exception
body: <p>I'm trying to display emails of users stored in firebase database.
  I've this below code</p>
  <pre><code>    snapsListView = findViewById(R.id.snapsList)
      val adapter = emails?.let { ArrayAdapter(this, android.R.layout.simple_list_item_1, it) }
      snapsListView?.adapter = adapter
  
      auth.currentUser?.uid?.let { FirebaseDatabase.getInstance().getReference().child(&quot;users&quot;).child(it).child(&quot;snaps&quot;).addChildEventListener(object: ChildEventListener{
          override fun onChildAdded(snapshot: DataSnapshot, previousChildName: String?) {
              emails?.add(snapshot.child(&quot;from&quot;).value as String)
  
              adapter?.notifyDataSetChanged()
              try {
                  for(x in emails!!){
                      Log.i(&quot;Emails&quot;, x)
                  }
              } catch (e: Exception) {
                  e.printStackTrace()
              }
          }
  </code></pre>
  <p>Emails are present in the database and as per the hierrarchy also, users-&gt; uid-&gt;snaps and snaps contains the email in &quot;from&quot;</p>
  <p>Don't know what is causing this error, or how do i resolve this.</p>
  <p>Always getting null pointer exception</p>