Add guard around location redirect.

This commit is contained in:
Mike Cao 2022-10-24 15:25:07 -07:00
parent 4bad94f436
commit 99c8752aa5
2 changed files with 5 additions and 2 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "umami", "name": "umami",
"version": "1.39.0-beta.1", "version": "1.39.0-beta.2",
"description": "A simple, fast, privacy-focused alternative to Google Analytics.", "description": "A simple, fast, privacy-focused alternative to Google Analytics.",
"author": "Mike Cao <mike@mikecao.com>", "author": "Mike Cao <mike@mikecao.com>",
"license": "MIT", "license": "MIT",

View File

@ -143,7 +143,10 @@
) { ) {
e.preventDefault(); e.preventDefault();
trackEvent(name).then(() => { trackEvent(name).then(() => {
location.href = get('href'); const href = get('href');
if (href) {
location.href = href;
}
}); });
} else { } else {
trackEvent(name); trackEvent(name);