From f06b85bc1e11805e80a00a75725af26ab9c0ce52 Mon Sep 17 00:00:00 2001 From: Nicolas Coden Date: Sat, 7 Apr 2018 23:47:52 +0200 Subject: [PATCH] fix: fix Magellan hash resolution without active link --- js/foundation.magellan.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/foundation.magellan.js b/js/foundation.magellan.js index 7c19cbb13..68784a7f0 100644 --- a/js/foundation.magellan.js +++ b/js/foundation.magellan.js @@ -177,7 +177,7 @@ class Magellan extends Plugin { let activeHash = ''; if(activeIdx !== undefined){ this.$active = this.$links.filter('[href="#' + this.$targets.eq(activeIdx).data('magellan-target') + '"]'); - activeHash = this.$active[0].getAttribute('href'); + if (this.$active.length) activeHash = this.$active[0].getAttribute('href'); }else{ this.$active = $(); } -- 2.47.2