mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-23 21:02:25 +01:00
Adding some checks to check if win is defined
This commit is contained in:
@@ -105,7 +105,7 @@ liberator.Buffer = function () //{{{
|
|||||||
function findScrollableWindow()
|
function findScrollableWindow()
|
||||||
{
|
{
|
||||||
var win = window.document.commandDispatcher.focusedWindow;
|
var win = window.document.commandDispatcher.focusedWindow;
|
||||||
if (win.scrollMaxX > 0 || win.scrollMaxY > 0)
|
if (win && (win.scrollMaxX > 0 || win.scrollMaxY > 0))
|
||||||
return win;
|
return win;
|
||||||
|
|
||||||
win = window.content;
|
win = window.content;
|
||||||
|
|||||||
@@ -1454,6 +1454,8 @@ liberator.StatusLine = function () //{{{
|
|||||||
if (!percent || typeof percent != "number")
|
if (!percent || typeof percent != "number")
|
||||||
{
|
{
|
||||||
var win = document.commandDispatcher.focusedWindow;
|
var win = document.commandDispatcher.focusedWindow;
|
||||||
|
if (!win)
|
||||||
|
return;
|
||||||
percent = win.scrollMaxY == 0 ? -1 : win.scrollY / win.scrollMaxY;
|
percent = win.scrollMaxY == 0 ? -1 : win.scrollY / win.scrollMaxY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user