1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-23 20:52:26 +01:00

Adding some checks to check if win is defined

This commit is contained in:
Daniel Bainton
2008-08-13 09:22:18 +00:00
parent 3375daf359
commit 67b0492431
2 changed files with 3 additions and 1 deletions

View File

@@ -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;

View File

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