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

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