From 07e3bebbce5a29ec18180f0ce62285524be51638 Mon Sep 17 00:00:00 2001 From: Davide Fantino <80767709+fantinodavide@users.noreply.github.com> Date: Sat, 25 Mar 2023 00:51:30 +0100 Subject: [PATCH] fix: re-tries for updateLayerList() --- mapvote.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/mapvote.js b/mapvote.js index 8df3bdb..38cccb2 100644 --- a/mapvote.js +++ b/mapvote.js @@ -1048,6 +1048,12 @@ export default class MapVote extends DiscordBasePlugin { async updateLayerList() { // Layers.layers = []; + if (!Layers.layers instanceof Array) { + this.verbose(1, `Could not update layer list. Re-trying in 1 second.`) + setTimeout(this.updateLayerList, 1000); + return; + } + this.verbose(1, 'Pulling updated layer list...'); const response = await axios.get( 'https://raw.githubusercontent.com/Squad-Wiki/squad-wiki-pipeline-map-data/master/completed_output/_Current%20Version/finished.json'