Don't break Ruffle if we encounter an embed or object without a size.

This commit is contained in:
David Wendt 2019-08-28 19:19:05 -04:00
parent adc1a79155
commit fc67f0872f
1 changed files with 2 additions and 2 deletions

View File

@ -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; }");
}
}