Don't crash when trying to export linked parts

Fixes issue #1176