From 14e074b1224dc78c0a1aaef5b3c97e41e92fa407 Mon Sep 17 00:00:00 2001 From: Loic d'Anterroches Date: Thu, 20 Aug 2009 15:14:42 +0200 Subject: [PATCH] Fixed to prevent the display of an invalid tree. --- src/IDF/Views/Source.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/IDF/Views/Source.php b/src/IDF/Views/Source.php index 541be76..3b00927 100644 --- a/src/IDF/Views/Source.php +++ b/src/IDF/Views/Source.php @@ -210,6 +210,13 @@ class IDF_Views_Source $page_title = $bc.' - '.$title; $cobject = $scm->getCommit($commit); + if (!$cobject) { + // Redirect to the first branch + $url = Pluf_HTTP_URL_urlForView('IDF_Views_Source::treeBase', + array($request->project->shortname, + $scm->getMainBranch())); + return new Pluf_HTTP_Response_Redirect($url); + } $in_branches = $scm->inBranches($commit, $request_file); $cache = Pluf_Cache::factory(); $key = sprintf('Project:%s::IDF_Views_Source::tree:%s::%s',