From 192084e0e795cb668b2eef72d347c4e5d2b00471 Mon Sep 17 00:00:00 2001 From: Andrew Sliwinski Date: Fri, 20 Apr 2018 11:36:16 -0400 Subject: [PATCH] Do not load extension if prefix is undefined --- src/serialization/sb2.js | 2 +- src/serialization/sb3.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/serialization/sb2.js b/src/serialization/sb2.js index 9063bcf2d..4c7c31862 100644 --- a/src/serialization/sb2.js +++ b/src/serialization/sb2.js @@ -521,7 +521,7 @@ const parseBlock = function (sb2block, addBroadcastMsg, getVariableId, extension const index = blockMetadata.opcode.indexOf('_'); const prefix = blockMetadata.opcode.substring(0, index); if (CORE_EXTENSIONS.indexOf(prefix) === -1) { - extensions.extensionIDs.add(prefix); + if (prefix !== '') extensions.extensionIDs.add(prefix); } // Block skeleton. diff --git a/src/serialization/sb3.js b/src/serialization/sb3.js index d7be7a98f..0bcaf1f30 100644 --- a/src/serialization/sb3.js +++ b/src/serialization/sb3.js @@ -720,7 +720,7 @@ const parseScratchObject = function (object, runtime, extensions, zip) { const index = blockJSON.opcode.indexOf('_'); const prefix = blockJSON.opcode.substring(0, index); if (CORE_EXTENSIONS.indexOf(prefix) === -1) { - extensions.extensionIDs.add(prefix); + if (prefix !== '') extensions.extensionIDs.add(prefix); } } }