don't fail on invalid analysis path (from the URL)

This commit is contained in:
Thibault Duplessis 2014-11-27 21:04:23 +01:00
parent 2940aed8f5
commit 387e01633c

View file

@ -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 = '',