Skip to content
Snippets Groups Projects
Commit 7097d16f authored by Eric Rosenbaum's avatar Eric Rosenbaum Committed by GitHub
Browse files

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

Check for empty sound array
parents 74dde69f c4decffc
No related branches found
No related tags found
No related merge requests found
......@@ -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 () {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment