Add a null check and make the CommandSender the console if necessary