code: private static void validateMessageText(String messageML) throws InvalidInputException {
      if (messageML == null) { throw new InvalidInputException("Message input is NULL"); }
  
      for (char ch : messageML.toCharArray()) {
        if (ch != '\n' && ch != '\r' && ch != '\t' && (ch < ' ')) {
          throw new InvalidInputException("Invalid control characters in message");
        }
      }
    }
docs: Check the input message text for null value and restricted characters.