fix version error if patch is not existing

This commit is contained in:
Maroxy 2021-10-23 12:31:08 +02:00
parent a22248136c
commit aa597e90a4

View file

@ -33,7 +33,7 @@ $(() => {
LauncherUI.setState(Genshinlib.version === null ? 'game-installation-available' : 'game-update-available'); LauncherUI.setState(Genshinlib.version === null ? 'game-installation-available' : 'game-update-available');
// Patch version is incorrect // Patch version is incorrect
else if (Genshinlib.getConfig().patch.version != Genshinlib.getPatchInfo().version) else if (Genshinlib.getConfig().patch && Genshinlib.getConfig().patch.version != Genshinlib.getPatchInfo().version)
{ {
// Patch is not available // Patch is not available
if (Genshinlib.getPatchInfo().version !== data.game.latest.version) if (Genshinlib.getPatchInfo().version !== data.game.latest.version)
@ -61,7 +61,7 @@ $(() => {
// Current patch is in testing phase, // Current patch is in testing phase,
// but stable is available // but stable is available
else if (Genshinlib.getConfig().patch.version == Genshinlib.getPatchInfo().version && Genshinlib.getConfig().patch.state == 'testing' && Genshinlib.getPatchInfo().state == 'stable') else if (Genshinlib.getConfig().patch && Genshinlib.getConfig().patch.version == Genshinlib.getPatchInfo().version && Genshinlib.getConfig().patch.state == 'testing' && Genshinlib.getPatchInfo().state == 'stable')
{ {
console.log(`%c> Applying patch...`, 'font-size: 16px'); console.log(`%c> Applying patch...`, 'font-size: 16px');