Fix traceback when syncing custom types

This fixes a traceback which occurs when a rendering error occurs when
the top files are checked before custom types are synced.