Rafay Systems Interview Question

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