Error printing out the null message to screen

So here is my code which is similar to the one on page 92. It isn’t printing the error message to the console for some reason. I am not sure if this because of the main function in Game.kt. I believe it isn’t because I named the function and called it from main in game.kt and still the same problem. Anyone know why by chance?

fun main() {

    var beverage = readLine()
    if(beverage!=null){
        beverage = beverage.capitalize()
        print(beverage)
    } else{
        println("Can't do that without crashing - beverage was null!")
    }
    }

Hello,

is the problem, that it does not use the else part?
Have you tested something like this:

var test:String? = null
if(test!=null){
    test = test.capitalize()
    print($test)
} else{
    println("Can't do that without crashing - test was null!")
}

This is working for me.
I can not say how to get into the else branch typing an input to readLine().
The kotlin site says this:
readLine(): Return the line read or null if the input stream is redirected to a file and the end of file has been reached.

Best Regards