Skip to content

Commit 9602df4

Browse files
committed
Removed code that checks that the workspace is headless in upgrade functions.
1 parent 84df4d3 commit 9602df4

File tree

2 files changed

+0
-12
lines changed

2 files changed

+0
-12
lines changed

src/blocks/mrc_class_method_def.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -623,10 +623,6 @@ export function getMethodNamesAlreadyOverriddenInWorkspace(
623623
* This function should only be called when upgrading old projects.
624624
*/
625625
export function upgrade_002_to_003(workspace: Blockly.Workspace): void {
626-
// Make sure the workspace is headless.
627-
if (workspace.rendered) {
628-
throw new Error('upgrade_002_to_003 should never be called with a rendered workspace.');
629-
}
630626
workspace.getBlocksByType(BLOCK_NAME).forEach(block => {
631627
(block as ClassMethodDefBlock).upgrade_002_to_003();
632628
});
@@ -637,10 +633,6 @@ export function upgrade_002_to_003(workspace: Blockly.Workspace): void {
637633
* This function should only be called when upgrading old projects.
638634
*/
639635
export function upgrade_004_to_005(workspace: Blockly.Workspace): void {
640-
// Make sure the workspace is headless.
641-
if (workspace.rendered) {
642-
throw new Error('upgrade_004_to_005 should never be called with a rendered workspace.');
643-
}
644636
workspace.getBlocksByType(BLOCK_NAME).forEach(block => {
645637
(block as ClassMethodDefBlock).upgrade_004_to_005();
646638
});

src/blocks/mrc_mechanism_component_holder.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -526,10 +526,6 @@ export function mrcDescendantsMayHaveChanged(workspace: Blockly.Workspace): void
526526
* This function should only be called when upgrading old projects.
527527
*/
528528
export function upgrade_001_to_002(workspace: Blockly.Workspace) {
529-
// Make sure the workspace is headless.
530-
if (workspace.rendered) {
531-
throw new Error('upgrade_001_to_002 should never be called with a rendered workspace.');
532-
}
533529
// Make sure the module type is ROBOT.
534530
if (getModuleTypeForWorkspace(workspace) !== storageModule.ModuleType.ROBOT) {
535531
throw new Error('upgrade_001_to_002 should only be called for a robot module.');

0 commit comments

Comments
 (0)