From 61b40ac97226b234520ecc44380ed62d92bfdac2 Mon Sep 17 00:00:00 2001 From: Adrian Date: Mon, 12 Aug 2024 12:59:23 -0400 Subject: [PATCH] Fixed conditional statement to ensure robustness in live environments to avoid potential issues in production --- src/ui/modal-ui-handler.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ui/modal-ui-handler.ts b/src/ui/modal-ui-handler.ts index 9340e1c17ed..c6a6cbbd2e1 100644 --- a/src/ui/modal-ui-handler.ts +++ b/src/ui/modal-ui-handler.ts @@ -83,7 +83,7 @@ export abstract class ModalUiHandler extends UiHandler { show(args: any[]): boolean { if (args.length >= 1 && "buttonActions" in args[0]) { super.show(args); - if ("fadeOut" in args[0]) { + if (args[0].hasOwnProperty("fadeOut") && typeof args[0].fadeOut === "function") { const overlay = this.scene.add.rectangle((( (this.getWidth() + (this.getMargin()[0] - this.getMargin()[3]))) / 2), ((this.getHeight() + (this.getMargin()[1] - this.getMargin()[2])) / 2),this.scene.game.canvas.width ,this.scene.game.canvas.height , 0); overlay.setName("rect-ui-overlay-modal"); overlay.setAlpha(0);