From 89bc1566c568ba8fc566e2687aa58c8ed3f81b41 Mon Sep 17 00:00:00 2001 From: Rashmi Patel Date: Fri, 22 Sep 2023 14:38:37 -0700 Subject: [PATCH 1/5] Fix: 7523 - non-nullable check for block variable and removed ! --- core/flyout_vertical.ts | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/core/flyout_vertical.ts b/core/flyout_vertical.ts index b3e656d0cad..9aa9732ee3e 100644 --- a/core/flyout_vertical.ts +++ b/core/flyout_vertical.ts @@ -233,29 +233,32 @@ export class VerticalFlyout extends Flyout { for (let i = 0, item; (item = contents[i]); i++) { if (item.type === 'block') { const block = item.block; - const allBlocks = block!.getDescendants(false); + if(block == null || block == undefined) { + continue; + } + const allBlocks = block.getDescendants(false); for (let j = 0, child; (child = allBlocks[j]); j++) { // Mark blocks as being inside a flyout. This is used to detect and // prevent the closure of the flyout if the user right-clicks on such // a block. child.isInFlyout = true; } - const root = block!.getSvgRoot(); - const blockHW = block!.getHeightWidth(); - const moveX = block!.outputConnection + const root = block.getSvgRoot(); + const blockHW = block.getHeightWidth(); + const moveX = block.outputConnection ? cursorX - this.tabWidth_ : cursorX; - block!.moveBy(moveX, cursorY); + block.moveBy(moveX, cursorY); const rect = this.createRect_( - block!, + block, this.RTL ? moveX - blockHW.width : moveX, cursorY, blockHW, i, ); - this.addBlockListeners_(root, block!, rect); + this.addBlockListeners_(root, block, rect); cursorY += blockHW.height + gaps[i]; } else if (item.type === 'button') { From a9a0d841020dc420d70f805dbe44b2761e2c815e Mon Sep 17 00:00:00 2001 From: Rashmi Patel Date: Fri, 22 Sep 2023 14:43:41 -0700 Subject: [PATCH 2/5] Fix: non nullable check for block variable --- core/flyout_vertical.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/flyout_vertical.ts b/core/flyout_vertical.ts index 9aa9732ee3e..6887789f20a 100644 --- a/core/flyout_vertical.ts +++ b/core/flyout_vertical.ts @@ -233,7 +233,7 @@ export class VerticalFlyout extends Flyout { for (let i = 0, item; (item = contents[i]); i++) { if (item.type === 'block') { const block = item.block; - if(block == null || block == undefined) { + if(block == undefined || block == null) { continue; } const allBlocks = block.getDescendants(false); From 00089250fb9d512569a81a4a6ae3cc6e218755e1 Mon Sep 17 00:00:00 2001 From: Rashmi Patel Date: Fri, 22 Sep 2023 15:49:24 -0700 Subject: [PATCH 3/5] fix: fixed styling issue --- core/flyout_vertical.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/flyout_vertical.ts b/core/flyout_vertical.ts index 92a7fb7499c..66f6046aeec 100644 --- a/core/flyout_vertical.ts +++ b/core/flyout_vertical.ts @@ -233,7 +233,7 @@ export class VerticalFlyout extends Flyout { for (let i = 0, item; (item = contents[i]); i++) { if (item.type === 'block') { const block = item.block; - if(block == undefined || block == null) { + if (block == undefined || block == null) { continue; } const allBlocks = block.getDescendants(false); From ddee1ca4b91d071f9662eb661c5b7f68b9327beb Mon Sep 17 00:00:00 2001 From: Rashmi Patel Date: Fri, 22 Sep 2023 16:34:37 -0700 Subject: [PATCH 4/5] fix: updated block variable nullable condition --- core/flyout_vertical.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/flyout_vertical.ts b/core/flyout_vertical.ts index 66f6046aeec..92a9ce035cd 100644 --- a/core/flyout_vertical.ts +++ b/core/flyout_vertical.ts @@ -233,7 +233,7 @@ export class VerticalFlyout extends Flyout { for (let i = 0, item; (item = contents[i]); i++) { if (item.type === 'block') { const block = item.block; - if (block == undefined || block == null) { + if (block == null) { continue; } const allBlocks = block.getDescendants(false); From a6bcdc7a666775a25ea13411de932f297cfae369 Mon Sep 17 00:00:00 2001 From: Rashmi Patel Date: Sun, 24 Sep 2023 23:42:05 -0400 Subject: [PATCH 5/5] Updated nullable condition for block variable --- core/flyout_vertical.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/flyout_vertical.ts b/core/flyout_vertical.ts index 92a9ce035cd..4ab2523be26 100644 --- a/core/flyout_vertical.ts +++ b/core/flyout_vertical.ts @@ -233,7 +233,7 @@ export class VerticalFlyout extends Flyout { for (let i = 0, item; (item = contents[i]); i++) { if (item.type === 'block') { const block = item.block; - if (block == null) { + if (!block) { continue; } const allBlocks = block.getDescendants(false);