Fix uninitialised value warnings for unconverted actions.
[catagits/Gitalist.git] / lib / Gitalist / Controller / Root.pm
index b8eb602..faa9964 100644 (file)
@@ -66,7 +66,8 @@ sub _get_commit {
 
   # FIXME this can die when everything is migrated
   my ($m, $pd);
-  if ($c->stash->{current_model} eq 'GitRepos') {
+  if (defined $c->stash->{current_model} &&
+          $c->stash->{current_model} eq 'GitRepos') {
       $m = $c->model()->project($c->stash->{project});
       $pd = $m->path;
   } else {
@@ -578,7 +579,8 @@ sub end : ActionClass('RenderView') {
   my ($self, $c) = @_;
   # Give project views the current HEAD.
   if ($c->stash->{project}) {
-      if ($c->stash->{current_model} eq 'GitRepos') {
+      if ($c->stash->{current_model} &&
+              $c->stash->{current_model} eq 'GitRepos') {
           my $project = $c->model()->project($c->stash->{project});
           $c->stash->{HEAD} = $project->head_hash;
       } else {