Handle NULL and empty string situations.