Merge pull request #102 from ericrosenbaum/bugfix/dynamic-menus

Check for empty sound array
This commit is contained in:
Eric Rosenbaum authored and GitHub committed 2017-02-16 10:59:31 -05:00
commit 7097d16ffd
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 () {