From 99c8752aa5f99420adff4000151f096d04a715c8 Mon Sep 17 00:00:00 2001 From: Mike Cao Date: Mon, 24 Oct 2022 15:25:07 -0700 Subject: [PATCH] Add guard around location redirect. --- package.json | 2 +- tracker/index.js | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 35200b71..92291b8d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "umami", - "version": "1.39.0-beta.1", + "version": "1.39.0-beta.2", "description": "A simple, fast, privacy-focused alternative to Google Analytics.", "author": "Mike Cao ", "license": "MIT", diff --git a/tracker/index.js b/tracker/index.js index 100fd24a..3edca438 100644 --- a/tracker/index.js +++ b/tracker/index.js @@ -143,7 +143,10 @@ ) { e.preventDefault(); trackEvent(name).then(() => { - location.href = get('href'); + const href = get('href'); + if (href) { + location.href = href; + } }); } else { trackEvent(name);