Skip to content

Commit

Permalink
Add undefined guard for window.devicePixelRatio (chartjs#5324)
Browse files Browse the repository at this point in the history
  • Loading branch information
SeanSobey authored and simonbrunel committed Mar 10, 2018
1 parent 7f6e2c0 commit 7d22f4e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/core/core.helpers.js
Expand Up @@ -502,7 +502,7 @@ module.exports = function(Chart) {
document.defaultView.getComputedStyle(el, null).getPropertyValue(property);
};
helpers.retinaScale = function(chart, forceRatio) {
var pixelRatio = chart.currentDevicePixelRatio = forceRatio || window.devicePixelRatio || 1;
var pixelRatio = chart.currentDevicePixelRatio = forceRatio || (typeof window !== 'undefined' && window.devicePixelRatio) || 1;
if (pixelRatio === 1) {
return;
}
Expand Down

0 comments on commit 7d22f4e

Please sign in to comment.