mirror of
https://github.com/scratchfoundation/scratch-analysis.git
synced 2025-05-02 00:43:29 -04:00
Wrap SavedExtension in try-catch
Some sb2 records don't contain Extensions expected by clients (ie. env-crawler).
This commit is contained in:
parent
0f4220d101
commit
5737e152ac
1 changed files with 8 additions and 1 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue