From 6dd7789a2a8c2e48103a6cfcde41bc0151f3acba Mon Sep 17 00:00:00 2001 From: Brendan Abbott Date: Mon, 19 Dec 2016 14:08:40 +1000 Subject: [PATCH] Only request facts if a repo is present --- material/assets/javascripts/application.js | 1 + src/assets/javascripts/application.js | 1 + 2 files changed, 2 insertions(+) diff --git a/material/assets/javascripts/application.js b/material/assets/javascripts/application.js index ba9411c57..4abd3a303 100644 --- a/material/assets/javascripts/application.js +++ b/material/assets/javascripts/application.js @@ -739,6 +739,7 @@ var Application = /* Retrieve the facts for the given repository type */ ;(function () { var el = document.querySelector("[data-md-source]"); + if (!el) return Promise.resolve([]); switch (el.dataset.mdSource) { case "github": return new _Material2.default.Source.Adapter.GitHub(el).fetch(); diff --git a/src/assets/javascripts/application.js b/src/assets/javascripts/application.js index 9c8f66d66..ae1b693b8 100644 --- a/src/assets/javascripts/application.js +++ b/src/assets/javascripts/application.js @@ -196,6 +196,7 @@ export default class Application { /* Retrieve the facts for the given repository type */ ;(() => { const el = document.querySelector("[data-md-source]") + if (!el) return Promise.resolve([]) switch (el.dataset.mdSource) { case "github": return new Material.Source.Adapter.GitHub(el).fetch() default: return Promise.resolve([])