From fc67f0872fc081a2c0aad776032490a42ca65e99 Mon Sep 17 00:00:00 2001 From: David Wendt Date: Wed, 28 Aug 2019 19:19:05 -0400 Subject: [PATCH] Don't break Ruffle if we encounter an embed or object without a size. --- web/js-src/ruffle-player.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web/js-src/ruffle-player.js b/web/js-src/ruffle-player.js index b35af79b0..34ee44ae1 100644 --- a/web/js-src/ruffle-player.js +++ b/web/js-src/ruffle-player.js @@ -43,11 +43,11 @@ export class RufflePlayer extends HTMLElement { this.dynamic_styles.sheet.deleteRule(i); } - if (!isNaN(parseInt(this.attributes.width.value))) { + if (this.attributes.width && !isNaN(parseInt(this.attributes.width.value))) { this.dynamic_styles.sheet.insertRule(":host { width: " + this.attributes.width.value + "px; }"); } - if (!isNaN(parseInt(this.attributes.height.value))) { + if (this.attributes.height && !isNaN(parseInt(this.attributes.height.value))) { this.dynamic_styles.sheet.insertRule(":host { height: " + this.attributes.height.value + "px; }"); } }