Skip to content

Commit 4562652

Browse files
Add function exists check
1 parent 246ca20 commit 4562652

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/Engine.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@ function startGame(string $gameName): void
99
{
1010
$name = greeting();
1111
$game = "BrainGames\\Games\\Brain\\{$gameName}\\startBrain{$gameName}";
12-
$game($name);
12+
13+
if (function_exists($game)) {
14+
$game($name);
15+
}
1316
}
1417

1518
function greeting(): string

0 commit comments

Comments
 (0)