Update render.py

Check if 'parent' attr exists.