Skip to content

Commit

Permalink
Fix maze skins crashing if larger than max
Browse files Browse the repository at this point in the history
Off by one error on length.  Setting &skin=9 in the URL would clamp down to 3, instead of 2.  This crashed the page.
  • Loading branch information
NeilFraser committed Nov 8, 2021
1 parent 2e1caaf commit 07cbe40
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion appengine/maze/js/maze.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@ Maze.SKINS = [
crashType: Maze.CRASH_FALL
}
];
Maze.SKIN_ID = BlocklyGames.getNumberParamFromUrl('skin', 0, Maze.SKINS.length);
Maze.SKIN_ID =
BlocklyGames.getNumberParamFromUrl('skin', 0, Maze.SKINS.length - 1);
Maze.SKIN = Maze.SKINS[Maze.SKIN_ID];

/**
Expand Down

0 comments on commit 07cbe40

Please sign in to comment.