1 min readJun 16, 2017
Made a mistake in the example which can be corrected by replacing msg = readLine() with msg = readLine() ?: “”
What is happening in the replacement is that a empty String is assigned to msg if the readlLine function returns null. So if a user just presses the Enter key after readLine is called then no input has been entered and readLine returns null.
Have fixed the code example. Please let me know if there are any other code samples that need to be fixed.