Detect window safely

This commit is contained in:
Piro / YUKI Hiroshi 2014-10-01 00:27:30 +09:00
parent 20e58a5b0b
commit fc7f336c69

View File

@ -67,7 +67,10 @@ if (typeof window == 'undefined' ||
addTask : function(aTask, aBeginningValue, aTotalChange, aDuration, aRelatedWindow) addTask : function(aTask, aBeginningValue, aTotalChange, aDuration, aRelatedWindow)
{ {
if (!aRelatedWindow && window && window instanceof window.Window) if (!aRelatedWindow &&
window &&
typeof window.Window == 'function' &&
window instanceof window.Window)
aRelatedWindow = window; aRelatedWindow = window;
if (!aTask || !aRelatedWindow) return; if (!aTask || !aRelatedWindow) return;