If either the source or destination pointers are nullptr, we shouldn't continue otherwise we dereference nullptr or memcpy with nullptr which is undefined. (Also move the check to return as soon as possible.)