Fix 516-Export Canvas-the Group Layer exported must be nested

-Add null pointer test to avoid the crash
-add a few comments around