Checking the validity of the given link and showing an error if it is invalid.