Application crashes if the back button is pressed

I have a simple application consisting of one activity and multiple fragments.
Firstly, the up button on the Taskbar doesn’t work while If I press the back button on the system, the app simply crashes. What might be the possible reason? I am new to android development in Kotlin.