diff --git a/CookieMonster.js b/CookieMonster.js index 9891323..5ed52a9 100644 --- a/CookieMonster.js +++ b/CookieMonster.js @@ -3889,7 +3889,9 @@ CM.Disp.AddMissingUpgrades = function() { l('menu').children[5].appendChild(upgrades) } if (CM.Cache.MissingUpgrades) { - var normalUpgradesOwned = Game.UpgradesByPool[""].length + Game.UpgradesByPool["tech"].length - l('menu').children[6].childNodes[2].children.length; + if (Game.UpgradesOwned) { + var normalUpgradesOwned = Game.UpgradesByPool[""].length + Game.UpgradesByPool["tech"].length - l('menu').children[6].childNodes[2].children.length; + } else var normalUpgradesOwned = 0; var title = document.createElement('div'); title.id = "CMMissingUpgradesTitle"; title.className = "listing"; diff --git a/src/Disp.js b/src/Disp.js index be181a0..ccf77e9 100644 --- a/src/Disp.js +++ b/src/Disp.js @@ -2708,7 +2708,9 @@ CM.Disp.AddMissingUpgrades = function() { l('menu').children[5].appendChild(upgrades) } if (CM.Cache.MissingUpgrades) { - var normalUpgradesOwned = Game.UpgradesByPool[""].length + Game.UpgradesByPool["tech"].length - l('menu').children[6].childNodes[2].children.length; + if (Game.UpgradesOwned) { + var normalUpgradesOwned = Game.UpgradesByPool[""].length + Game.UpgradesByPool["tech"].length - l('menu').children[6].childNodes[2].children.length; + } else var normalUpgradesOwned = 0; var title = document.createElement('div'); title.id = "CMMissingUpgradesTitle"; title.className = "listing";