There's no need to check for an empty string: the buffer will either return NULL or a valid string.
NULL