Removing unnecessary check against NULL for error pointers