From 387e01633c0b38726faf949697b562b98c4be3b4 Mon Sep 17 00:00:00 2001 From: Thibault Duplessis Date: Thu, 27 Nov 2014 21:04:23 +0100 Subject: [PATCH] don't fail on invalid analysis path (from the URL) --- ui/analyse/src/ctrl.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/ui/analyse/src/ctrl.js b/ui/analyse/src/ctrl.js index 5d9d964984..2a3c2fefd6 100644 --- a/ui/analyse/src/ctrl.js +++ b/ui/analyse/src/ctrl.js @@ -23,7 +23,13 @@ module.exports = function(cfg, router, i18n, onChange) { var situationCache = {}; var showGround = function() { - var moves = this.analyse.moveList(this.vm.path); + var moves; + try { + moves = this.analyse.moveList(this.vm.path); + } catch (e) { + this.vm.path = treePath.default(); + moves = this.analyse.moveList(this.vm.path); + } var nbMoves = moves.length; var ply, move, cached, fen, hash = '', h = '',