As clang told us: we have to check for empty buffer here - not null pointer.