Checks if input exists before outputting.