title: 'void androidx.appcompat.app.ActionBar.setTitle(java.lang.CharSequence)' on a null object reference
body: <p>Unable to load my application , it displays null pointer exception
  Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void androidx.appcompat.app.ActionBar.setTitle(java.lang.CharSequence)' on a null object reference
  at com.example.android.bettingapp.DashboardActivity.onCreate(DashboardActivity.kt:27)</p>
  <blockquote>
  <p>DashboardActivity</p>
  </blockquote>
  <pre><code>class DashboardActivity : AppCompatActivity() {
  private lateinit var dashboardBinding: ActivityDashboardBinding
  override fun onCreate(savedInstanceState: Bundle?) {
      super.onCreate(savedInstanceState)
      dashboardBinding = ActivityDashboardBinding.inflate(layoutInflater)
      setContentView(dashboardBinding.root)
      setSupportActionBar(myToolBar)
      supportActionBar?.hide()
      val navView: BottomNavigationView = dashboardBinding.bottomNavView
      val navController = findNavController(R.id.nav_host_fragment)
      val appBarConfiguration = AppBarConfiguration(
          setOf(
              R.id.homeFragment,
              R.id.newBoastFragment,
              R.id.myBoastFragment,
              R.id.profileFragment
          )
      )
      setupActionBarWithNavController(navController, appBarConfiguration)
      navView.setupWithNavController(navController)
      supportActionBar?.setDisplayHomeAsUpEnabled(true)
      supportActionBar?.setHomeButtonEnabled(true)
  }
  </code></pre>
  <p>}</p>