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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cm-chessboard",
3
- "version": "7.3.1",
3
+ "version": "7.3.2",
4
4
  "description": "A JavaScript chessboard which is lightweight, ES6 module based, responsive, SVG rendered and without dependencies.",
5
5
  "keywords": [
6
6
  "chess",
@@ -290,12 +290,14 @@ export class ChessboardView {
290
290
  }
291
291
 
292
292
  getPieceElement(square) {
293
- if (square.length < 2) {
294
- throw new Error("980e03")
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
  }