Fix issue that generates exception with Pattern when getSubject returns None