Check for empty sound array

This commit is contained in:
Eric Rosenbaum committed 2017-02-15 17:27:36 -05:00
1 parent 74dde69fd0
commit c4decffcdb
1 file changed
+5 -1
+5 -1
View File
@@ -22,7 +22,11 @@ module.exports = function (vm) {
};
const soundsMenu = function () {
return vm.editingTarget.sprite.sounds.map(sound => [sound.name, sound.name]);
const sounds = vm.editingTarget.sprite.sounds;
if (sounds.length === 0) {
return [['', '']];
}
return sounds.map(sound => [sound.name, sound.name]);
};
const costumesMenu = function () {