Do not load extension if prefix is undefined

This commit is contained in:
Andrew Sliwinski 2018-04-20 11:36:16 -04:00
parent fd97892eb1
commit 192084e0e7
2 changed files with 2 additions and 2 deletions

View file

@ -521,7 +521,7 @@ const parseBlock = function (sb2block, addBroadcastMsg, getVariableId, extension
const index = blockMetadata.opcode.indexOf('_'); const index = blockMetadata.opcode.indexOf('_');
const prefix = blockMetadata.opcode.substring(0, index); const prefix = blockMetadata.opcode.substring(0, index);
if (CORE_EXTENSIONS.indexOf(prefix) === -1) { if (CORE_EXTENSIONS.indexOf(prefix) === -1) {
extensions.extensionIDs.add(prefix); if (prefix !== '') extensions.extensionIDs.add(prefix);
} }
// Block skeleton. // Block skeleton.

View file

@ -720,7 +720,7 @@ const parseScratchObject = function (object, runtime, extensions, zip) {
const index = blockJSON.opcode.indexOf('_'); const index = blockJSON.opcode.indexOf('_');
const prefix = blockJSON.opcode.substring(0, index); const prefix = blockJSON.opcode.substring(0, index);
if (CORE_EXTENSIONS.indexOf(prefix) === -1) { if (CORE_EXTENSIONS.indexOf(prefix) === -1) {
extensions.extensionIDs.add(prefix); if (prefix !== '') extensions.extensionIDs.add(prefix);
} }
} }
} }