Skip to content

Commit

Permalink
Fix VG fail when parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
drodichkin committed Jan 17, 2025
1 parent ba0c2bf commit 1063151
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/utils/backend/vatglasses.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,14 @@ function combineJsonFiles(zip: AdmZip): VatglassesData {
if (entry.entryName.endsWith('.json')) {
let fileName = entry.entryName.split('/').pop(); // Get the filename
if (fileName) {
fileName = fileName.replace('.json', ''); // Remove the .json extension
const fileData = JSON.parse(entry.getData().toString('utf-8'));
combinedData[fileName] = fileData; // Use the filename as the key
try {
fileName = fileName.replace('.json', ''); // Remove the .json extension
const fileData = JSON.parse(entry.getData().toString('utf-8'));
combinedData[fileName] = fileData; // Use the filename as the key
}
catch (e) {
console.warn(`Error parsing ${ fileName }`, e);
}
}
}
});
Expand Down

0 comments on commit 1063151

Please sign in to comment.