Attempt to robustify identity detection at loading (no more temporary anonymous)
[vchess.git] / client / src / components / BaseGame.vue
index 4af4e15..0c20b0b 100644 (file)
@@ -284,6 +284,9 @@ export default {
       let movingPiece = document.querySelector(
         "#" + getSquareId(move.start) + " > img.piece"
       );
+      // For some unknown reasons Opera get "movingPiece == null" error
+      // TOOO: is it calling 'animate()' twice ? One extra time ?
+      if (!movingPiece) return;
       // HACK for animation (with positive translate, image slides "under background")
       // Possible improvement: just alter squares on the piece's way...
       const squares = document.getElementsByClassName("board");