From b794b80e23d2cc416c1323ebc0d2afa6590e5e03 Mon Sep 17 00:00:00 2001 From: yujo Date: Mon, 15 Feb 2021 23:57:27 +0900 Subject: [PATCH] =?UTF-8?q?refactor:=20winners=EA=B0=80=20=EC=97=86?= =?UTF-8?q?=EC=9D=84=20=EA=B2=BD=EC=9A=B0=20=EC=98=88=EC=99=B8=EC=B2=98?= =?UTF-8?q?=EB=A6=AC=EA=B0=80=20=EA=B0=80=EB=8A=A5=ED=95=98=EB=8F=84?= =?UTF-8?q?=EB=A1=9D=20alert=20=ED=95=A8=EC=88=98=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/js/game/printGameResult.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/js/game/printGameResult.js b/src/js/game/printGameResult.js index e9ade2f21..9eb00b944 100644 --- a/src/js/game/printGameResult.js +++ b/src/js/game/printGameResult.js @@ -3,6 +3,11 @@ import { getWinners } from './getWinners.js'; import { restartGame } from './restartGame.js'; const alertGameResult = (winners) => { + if (!winners) { + alert('❌ Error : 우승자를 찾지 못 했습니다. ❌'); + throw new Error('우승자를 찾지 못 했습니다.'); + } + alert(`🎉 축하드립니다! 우승자는 ${winners}입니다! 🎉`); };