Web Dev Solutions

Catalin Mititiuc

aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/modules/gameboard.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/modules/gameboard.js b/src/modules/gameboard.js
index a6b3e22..be725b5 100644
--- a/src/modules/gameboard.js
+++ b/src/modules/gameboard.js
@@ -171,7 +171,7 @@ function selectOffBoard() {
function select(data) {
const counter = data && (soldier.getCounter(svg, data) || soldier.createCounter(data));
- const isSelected = counter?.classList.contains(soldier.getSelectedClass());
+ const isSelected = data && data.classList && data.classList.contains('selected');
deselect();