From d2d68a64376f347e23f1ad0ab6b1c6fcdc8f9dd9 Mon Sep 17 00:00:00 2001 From: YUKI Hiroshi Date: Thu, 19 Mar 2015 11:32:03 +0900 Subject: [PATCH] Avoid errors from elements without box object --- modules/browserUIShowHideObserver.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/browserUIShowHideObserver.js b/modules/browserUIShowHideObserver.js index a92659af..31f3ac4b 100644 --- a/modules/browserUIShowHideObserver.js +++ b/modules/browserUIShowHideObserver.js @@ -144,10 +144,10 @@ BrowserUIShowHideObserver.prototype = { serializeBoxState : function BrowserUIShowHideObserver_serializeBoxState(aElement) { aElement = aElement || this.box; - var box = aElement.boxObject; + var box = aElement.boxObject || {}; // Some times there is no boxObject (ex. HTML element) return JSON.stringify({ - width : box.width, - height : box.height, + width : box.width || 0, + height : box.height || 0, hidden : Boolean(aElement.hidden), collapsed : Boolean(aElement.collapsed) });