metadata Don't crash if folder name is not given

Fixes #2413