Fix error for empty repositories

This commit is contained in:
Rene Pfeuffer
2019-12-13 14:41:55 +01:00
parent 5e47ef0323
commit 7bd48c91bc

View File

@@ -28,7 +28,7 @@ export function fetchSourcesWithoutOptionalLoadingState(
.then(response => response.json())
.then((sources: File) => {
dispatch(fetchSourcesSuccess(repository, revision, path, sources));
if (sources._embedded.children && sources._embedded.children.find(c => c.partialResult)) {
if (sources._embedded && sources._embedded.children && sources._embedded.children.find(c => c.partialResult)) {
setTimeout(() => dispatch(fetchSourcesWithoutOptionalLoadingState(repository, revision, path, false)), 3000);
}
})