publish: safety check in metadata reducer

This commit is contained in:
Matilde Park 2020-03-06 15:50:03 -05:00
parent 8166115751
commit d46b271ba2

View File

@ -18,7 +18,7 @@ export class MetadataReducer {
Object.keys(data).map((channel) => {
let channelObj = data[channel];
let app = data[channel]["app-name"];
if (!metadata[app]) {
if (!(app in metadata)) {
metadata[app] = {};
}
metadata[app][channelObj["app-path"]] = channelObj;
@ -32,7 +32,7 @@ export class MetadataReducer {
if (data) {
let metadata = state.associations;
let app = data["app-name"];
if (!metadata[app]) {
if (!(app in metadata)) {
metadata[app] = {};
}
metadata[app][data["app-path"]] = data;
@ -55,7 +55,7 @@ export class MetadataReducer {
if (data) {
let metadata = state.associations;
let app = data["app-name"];
if (!metadata[app]) {
if (!(app in metadata)) {
return false;
}
delete metadata[app][data["app-path"]];