diff --git a/content/buffer.js b/content/buffer.js index 4d3dc88f..8b20f1dd 100644 --- a/content/buffer.js +++ b/content/buffer.js @@ -105,7 +105,7 @@ liberator.Buffer = function () //{{{ function findScrollableWindow() { var win = window.document.commandDispatcher.focusedWindow; - if (win.scrollMaxX > 0 || win.scrollMaxY > 0) + if (win && (win.scrollMaxX > 0 || win.scrollMaxY > 0)) return win; win = window.content; diff --git a/content/ui.js b/content/ui.js index aadaa566..9e560f66 100644 --- a/content/ui.js +++ b/content/ui.js @@ -1454,6 +1454,8 @@ liberator.StatusLine = function () //{{{ if (!percent || typeof percent != "number") { var win = document.commandDispatcher.focusedWindow; + if (!win) + return; percent = win.scrollMaxY == 0 ? -1 : win.scrollY / win.scrollMaxY; }