Add additional check to getExtensions function

This commit is contained in:
Connor Hudson 2018-06-21 09:45:32 -04:00
parent ccfd25d864
commit 5dfbe422d7

View file

@ -123,9 +123,11 @@ class Preview extends React.Component {
return;
}
const extensionSet = new Set();
if (projectData[0].targets) {
projectData[0].targets.forEach(target => target.extensions.forEach(extension => {
extensionSet.add(EXTENSION_INFO[extension]);
}));
}
this.setState({
extensions: Array.from(extensionSet)
});