check NULL of pTemplateRoot in DoDataMerge