From 44787356b9297d865c9ceb0b30867b9e6189213b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Kol=C3=A1rik?= Date: Fri, 27 Dec 2024 23:00:11 +0100 Subject: [PATCH] Fix showing measurement with no locations --- src/views/pages/globalping/_index.html | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/views/pages/globalping/_index.html b/src/views/pages/globalping/_index.html index a8853e5d0..815b2f377 100644 --- a/src/views/pages/globalping/_index.html +++ b/src/views/pages/globalping/_index.html @@ -2270,7 +2270,7 @@ // only the first target's response returns locations if (isFirstShareReq) { - let magicValue = testRes.locations.reduce((res, loc) => { + let magicValue = testRes.locations?.reduce((res, loc) => { if (loc.magic) { res += res.length ? `, ${loc.magic}` : loc.magic; @@ -2592,8 +2592,11 @@ setTimeout(() => { // do not zoom if test was done for the World. if ( - locations.length === 1 - && (locations[0].magic.toLowerCase() === 'world' || locations[0].magic === '') + !locations + || ( + locations.length === 1 + && (locations[0].magic.toLowerCase() === 'world' || locations[0].magic === '') + ) ) { return; }