'How to Set the name, email, and profile to respective field in Kotlin | Android

Because of this two line my app is getting terminated

    sName = findViewById(R.id.user_name)
    sName.text = name

the complete code

//Write your code here
    mAuth = FirebaseAuth.getInstance()

    //display profile information such as profile_image, name, email account
    val user = mAuth.currentUser
    profileImage = user?.photoUrl.toString()
    name = user?.displayName.toString()
    email = user?.email.toString()

    Log.e("DisplayName", name)
    Log.e("Profile_url", profileImage)
    Log.e("Email", email)

What can be the solution for this



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source