Skip to content

Commit

Permalink
Merge pull request #40 from Aramics/patch-1
Browse files Browse the repository at this point in the history
Prevent empty string from being passed to getElementById() when the r…
  • Loading branch information
rehhouari authored Aug 5, 2024
2 parents 4a1828a + 4d8a492 commit 321838f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -539,7 +539,7 @@ export default function (Alpine) {

// show templates added programmatically
if (route.template && route.programmaticTemplate) {
let target = document.getElementById(route.templateTargetId) ?? document.getElementById(PineconeRouter.settings.templateTargetId)
let target = route.templateTargetId ? document.getElementById(route.templateTargetId) : document.getElementById(PineconeRouter.settings.templateTargetId);
if (cachedTemplates[route.template]) {
target.innerHTML = cachedTemplates[route.template]
endLoading()
Expand Down

0 comments on commit 321838f

Please sign in to comment.