Bugfix: Only try to load file if there's a path
This commit is contained in:
@ -162,7 +162,10 @@ export default class API {
|
|||||||
const unpublishedPromise = this.retrieveMetadata(contentKey)
|
const unpublishedPromise = this.retrieveMetadata(contentKey)
|
||||||
.then((data) => {
|
.then((data) => {
|
||||||
metaData = 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 }))
|
.then(fileData => ({ metaData, fileData }))
|
||||||
.catch(() => {
|
.catch(() => {
|
||||||
|
Reference in New Issue
Block a user