Catch failute that happens if no URL works

This commit is contained in:
Peter Hedenskog 2025-03-10 08:59:58 +01:00
parent 85bddc9835
commit 93cad74103
1 changed files with 6 additions and 1 deletions

View File

@ -17,7 +17,12 @@ export function pathToFolder(url, options, alias) {
const pathSegments = [];
const urlSegments = [];
pathSegments.push('pages', parsedUrl.hostname.split('.').join('_'));
// If a measurements fail and we use a script file and no URL
// has been tested, we don't have a hostname
if (parsedUrl.hostname) {
pathSegments.push('pages', parsedUrl.hostname.split('.').join('_'));
}
if (options.urlMetaData && options.urlMetaData[url]) {
pathSegments.push(options.urlMetaData[url]);