cm-chessboard 7.3.1 → 7.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -290,12 +290,14 @@ export class ChessboardView {
|
|
|
290
290
|
}
|
|
291
291
|
|
|
292
292
|
getPieceElement(square) {
|
|
293
|
-
if (square.length < 2) {
|
|
294
|
-
|
|
293
|
+
if (!square || square.length < 2) {
|
|
294
|
+
console.warn("invalid square", square)
|
|
295
|
+
return null
|
|
295
296
|
}
|
|
296
297
|
const piece = this.piecesGroup.querySelector(`g[data-square='${square}']`)
|
|
297
298
|
if (!piece) {
|
|
298
299
|
console.warn("no piece on", square)
|
|
300
|
+
return null
|
|
299
301
|
}
|
|
300
302
|
return piece
|
|
301
303
|
}
|