Skip to content

Commit

Permalink
7.0/fix about tab (#232)
Browse files Browse the repository at this point in the history
* Fixing case of non-string hash

- If the About tab is the first tab clicked, and the browser is Chrome then the
  hash passed to this function was: null. This would cause the function to error
  out when attempting to regex match against it. In Firefox the value provided
  in the same situation was: 'null'. Which allowed the 'match' function to not
  error out. This small change just coerces the value of 'hash' to a string if
  it is not already.

* Travis Fixes
  • Loading branch information
ryanrath authored Sep 8, 2017
1 parent 7bc29a6 commit 19bdf7f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions html/gui/js/CCR.js
Original file line number Diff line number Diff line change
Expand Up @@ -1368,10 +1368,14 @@ CCR.getParameter = function (name, source) {
* TAB
*/
CCR.tokenize = function (hash) {
var matches = hash.match(/^#?(([^:\\?]*):?([^:\\?]*):?([^:\\?]*)\??(.*))/);
var raw = (typeof hash !== 'string')
? String(hash)
: hash;

var matches = raw.match(/^#?(([^:\\?]*):?([^:\\?]*):?([^:\\?]*)\??(.*))/);

var tokens = {
raw: hash,
raw: raw,
content: matches[1],
root: matches[2],
tab: matches[3],
Expand Down

0 comments on commit 19bdf7f

Please sign in to comment.