Rafay Systems interview question

Now write code so that if the string was null it would output an error.