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);