Skip to content

Commit

Permalink
sparklines bugfix
Browse files Browse the repository at this point in the history
when using an empty segment parameter, clicking a sparkline resulted in the error "Segment parameter 'undefined' does not appear to have a valid format."
  • Loading branch information
timo-bes committed Apr 12, 2013
1 parent 09690c2 commit e11dbdb
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion plugins/CoreHome/templates/sparkline.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,12 @@ function initializeSparklines() {
delete params[sparklineUrlParamsToIgnore[i]];
}
for (var key in params) {
params[key] = decodeURIComponent(params[key]);
if (typeof params[key] == 'undefined') {
// this happens for example with an empty segment parameter
delete params[key];
} else {
params[key] = decodeURIComponent(params[key]);
}
}

// on click, reload the graph with the new url
Expand Down

0 comments on commit e11dbdb

Please sign in to comment.