Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added Error Handling when no more commits are available

  • Loading branch information...
commit 0ea9d0dfad1c85953e289efc253eb76e4eab9c7b 1 parent 0f686be
Lukas Domnick Lukx authored
13 src/GitList/Controller/NetworkController.php
View
@@ -55,6 +55,7 @@ function ($repo, $commitishPath, $page) use ($app) {
}
$nextPageUrl = null;
+
if ($pager['last'] !== $pager['current']) {
$nextPageUrl = $app['url_generator']->generate(
'networkData',
@@ -65,6 +66,18 @@ function ($repo, $commitishPath, $page) use ($app) {
)
);
}
+
+ // when no commits are given, return an empty response - issue #369
+ if( count($commits) === 0 ) {
+ return $app->json( array(
+ 'repo' => $repo,
+ 'commitishPath' => $commitishPath,
+ 'nextPage' => null,
+ 'start' => null,
+ 'commits' => $jsonFormattedCommits
+ ), 200
+ );
+ }
return $app->json( array(
'repo' => $repo,
2  web/js/networkGraph.js
View
@@ -351,7 +351,7 @@
}
function handleNoAvailableData() {
- console.log('No Data available');
+ window.console && console.log('No (more) Data available');
}
var awaitedParents = {};
Please sign in to comment.
Something went wrong with that request. Please try again.