Rewrite missing asset skip in the affirmative

This commit is contained in:
Karishma Chadha 2022-05-17 16:40:33 -04:00
parent 8b9ce99762
commit 2481f28191

View file

@ -17,13 +17,13 @@ const serializeAssets = function (runtime, assetType, optTargetId) {
for (let j = 0; j < currAssets.length; j++) { for (let j = 0; j < currAssets.length; j++) {
const currAsset = currAssets[j]; const currAsset = currAssets[j];
const asset = currAsset.broken ? currAsset.broken.asset : currAsset.asset; const asset = currAsset.broken ? currAsset.broken.asset : currAsset.asset;
if (!asset) { if (asset) {
continue; // Serialize asset if it exists, otherwise skip
assetDescs.push({
fileName: `${asset.assetId}.${asset.dataFormat}`,
fileContent: asset.data
});
} }
assetDescs.push({
fileName: `${asset.assetId}.${asset.dataFormat}`,
fileContent: asset.data
});
} }
} }
return assetDescs; return assetDescs;