From 50b719379f50934757a9ac932cdfc67c056f4c5c Mon Sep 17 00:00:00 2001 From: Tim Taubert Date: Thu, 21 Mar 2013 09:23:02 +0100 Subject: [PATCH] Bug 851845 - Intermittent (NS_ERROR_NOT_AVAILABLE) [nsIDOMWindowUtils.getScrollbarSize]; r=jaws --- toolkit/components/thumbnails/PageThumbs.jsm | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/toolkit/components/thumbnails/PageThumbs.jsm b/toolkit/components/thumbnails/PageThumbs.jsm index 31a5de704f0d..9200d6bea74f 100644 --- a/toolkit/components/thumbnails/PageThumbs.jsm +++ b/toolkit/components/thumbnails/PageThumbs.jsm @@ -244,7 +244,14 @@ this.PageThumbs = { let utils = aWindow.QueryInterface(Ci.nsIInterfaceRequestor) .getInterface(Ci.nsIDOMWindowUtils); let sbWidth = {}, sbHeight = {}; - utils.getScrollbarSize(false, sbWidth, sbHeight); + + try { + utils.getScrollbarSize(false, sbWidth, sbHeight); + } catch (e) { + // This might fail if the window does not have a presShell. + Cu.reportError("Unable to get scrollbar size in _determineCropSize."); + sbWidth.value = sbHeight.value = 0; + } // Even in RTL mode, scrollbars are always on the right. // So there's no need to determine a left offset.