Fix CPP template project crash
Merge pull request #8807 from Dhilan007/v3-cpptemplate

Fix CPP template project crash