From 6562f9a56a18dfe4528af405ffcb74ea2d553593 Mon Sep 17 00:00:00 2001 From: Luke Murphy Date: Tue, 11 Feb 2020 15:46:46 +0100 Subject: [PATCH] Don't blow up if no recordings are there --- voicegardens/static/voicegardens.js | 1 + 1 file changed, 1 insertion(+) diff --git a/voicegardens/static/voicegardens.js b/voicegardens/static/voicegardens.js index 03b5097..33cccef 100644 --- a/voicegardens/static/voicegardens.js +++ b/voicegardens/static/voicegardens.js @@ -126,6 +126,7 @@ function gardenShapes() { axios .get(archiveListingUrl) .then(function(response) { + if (!response.data.length) return; let randomIndex = floor(random(0, response.data.length - 1)); let url = response.data[randomIndex]; axios