diff --git a/templates/index.html b/templates/index.html
index 69f02ef..1662dd1 100644
--- a/templates/index.html
+++ b/templates/index.html
@@ -261,6 +261,9 @@
function shareOnFediverse(questionId, contentToShare) {
const instanceDomain = document.getElementById(`fediInstance`).value.trim();
+ if (!instanceDomain) {
+ return;
+ }
const shareUrl = `https://${instanceDomain}/share?text=${contentToShare}`;
window.open(shareUrl, '_blank');