From d237318ef4b548b81b879d15b71eee6274573463 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A1ssio=20Zen?= Date: Thu, 19 Jan 2017 17:28:06 -0200 Subject: [PATCH] Bugfix: Only try to load file if there's a path --- src/backends/github/API.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/backends/github/API.js b/src/backends/github/API.js index d398a706..1f0e87d4 100644 --- a/src/backends/github/API.js +++ b/src/backends/github/API.js @@ -162,7 +162,10 @@ export default class API { const unpublishedPromise = this.retrieveMetadata(contentKey) .then((data) => { metaData = data; - return this.readFile(data.objects.entry.path, null, data.branch); + if (data.objects.entry.path) { + return this.readFile(data.objects.entry.path, null, data.branch); + } + return Promise.reject(null); }) .then(fileData => ({ metaData, fileData })) .catch(() => {