From 3682a0212c987bed464427281997e95f3f7fe6f8 Mon Sep 17 00:00:00 2001 From: Federico Capoano Date: Wed, 25 Feb 2026 21:50:25 -0300 Subject: [PATCH] [chores] Stop JS logic in loci.js if map is not available This prevents javascript errors if the JS is loaded on pages where the user doesn't have permission to see the map. --- django_loci/static/django-loci/js/loci.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/django_loci/static/django-loci/js/loci.js b/django_loci/static/django-loci/js/loci.js index d8d591d..6951d93 100644 --- a/django_loci/static/django-loci/js/loci.js +++ b/django_loci/static/django-loci/js/loci.js @@ -570,6 +570,9 @@ django.jQuery(function ($) { }); function geometryListeners() { + if (!getMap()) { + return; + } var featureGroup = getFeatureGroup(), marker = getMarker(); featureGroup.on("layeradd", function () {