You wouldn’t allow someone to come over a throw garbage all over you, so why would you let someone talk trash about your career/job. Always protect your environment, if you start having doubts about what you are doing then it will greatly affect your growth. You cannot grow and reach your potential when there is doubt in your mind.
Don’t let anyone rain on your parade. Your environment is your own, it doesn’t matter what path others take or what they think. Continue to grow with confidence and always remember just how important your environment is.