diff --git a/index.html b/index.html
index 788a3d98e..fad6fd43a 100644
--- a/index.html
+++ b/index.html
@@ -25,12 +25,12 @@
let prefix = '';
- if (url.includes('://homebrewery-stage.')) {
+ if (url && url?.includes('://homebrewery-stage.')) {
prefix = `Stage `;
- } else if (url.includes('://homebrewery-pr-')) {
+ } else if (url?.includes('://homebrewery-pr-')) {
const match = url.match(/pr-(\d+)/);
if (match) prefix = `PR-${match[1]} `;
- } else if (url.includes('://localhost')) {
+ } else if (url?.includes('://localhost')) {
prefix = 'Local ';
}