Wrap SavedExtension in try-catch

Some sb2 records don't contain Extensions expected by clients (ie. env-crawler).
This commit is contained in:
K.R. 2024-09-18 08:50:56 -04:00 committed by GitHub
parent 0f4220d101
commit 5737e152ac
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -166,7 +166,14 @@ const blocks = function (project) {
*/
const extensions = function (project) {
const result = {count: 0, id: []};
const ext = project.info.savedExtensions;
try {
const ext = project.info.savedExtensions;
} catch (error) {
if (error instanceof TypeError) {
console.log("A TypeError occurred:", error.message);
}
}
// Check to ensure project includes any extensions
if (typeof ext === 'undefined') return result;