Permalink
Browse files

Set neighbours to false if none exist

  • Loading branch information...
1 parent 1ec74d3 commit c2f808e428a698788ef8d63b71ade61a0ba566ed @kolber committed Apr 4, 2013
Showing with 2 additions and 2 deletions.
  1. +2 −2 app/page-data.inc.php
View
@@ -15,10 +15,10 @@ static function extract_closest_siblings($siblings, $file_path) {
if(!empty($siblings) && isset($siblings[$file_path])) {
# previous sibling
if(isset($keys[$keyIndexes[$file_path] - 1])) $neighbors[] = $keys[$keyIndexes[$file_path] - 1];
- else $neighbors[] = $keys[count($keys) - 1];
+ else $neighbors[] = false;
# next sibling
if(isset($keys[$keyIndexes[$file_path] + 1])) $neighbors[] = $keys[$keyIndexes[$file_path] + 1];
- else $neighbors[] = $keys[0];
+ else $neighbors[] = false;
}
return !empty($neighbors) ? $neighbors : array(false, false);
}

0 comments on commit c2f808e

Please sign in to comment.