From a062f09deff3747cd680eca00239d10103028c79 Mon Sep 17 00:00:00 2001 From: Alexandr Date: Sat, 25 May 2024 21:19:32 +0300 Subject: [PATCH] fixed `Cannot read properties of undefined (reading '0')` error within getURLType function --- lib/util.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/util.js b/lib/util.js index 20fe8f68..a33f58ae 100644 --- a/lib/util.js +++ b/lib/util.js @@ -235,7 +235,7 @@ function buildSafeBase(str) { const ABSOLUTE_SCHEME = /^[A-Za-z0-9\+\-\.]+:/; function getURLType(url) { - if (url[0] === "/") { + if (url && url[0] === "/") { if (url[1] === "/") return "scheme-relative"; return "path-absolute"; }