* platform.isAttached should return false if canvas is false-y
* change styling to conform to codeclimate linter
let maxWidth: number, maxHeight: number;
if (width === undefined || height === undefined) {
- const container = _getParentNode(canvas);
+ const container = canvas && _getParentNode(canvas);
if (!container) {
width = canvas.clientWidth;
height = canvas.clientHeight;
* @param {HTMLCanvasElement} canvas
*/
isAttached(canvas) {
- const container = _getParentNode(canvas);
+ const container = canvas && _getParentNode(canvas);
return !!(container && container.isConnected);
}
}