diff options
author | Jonathan "Duke" Leto <jonathan@leto.net> | 2011-05-22 21:02:23 -0700 |
---|---|---|
committer | Jonathan "Duke" Leto <jonathan@leto.net> | 2011-05-22 21:02:23 -0700 |
commit | 84147ee6d4a5d53d93f4a73300a192f854eb1ccd (patch) | |
tree | 883782c9efc36d21f1efbc19bb4f593ca9e5a9d8 /lib | |
parent | Remove dep on Git::Repository (diff) | |
parent | Make hook test data refer to the new git repo for testing (diff) | |
download | jitterbug-84147ee6d4a5d53d93f4a73300a192f854eb1ccd.tar.gz |
Merge branch 'master' into git_refactor
Diffstat (limited to '')
-rw-r--r-- | lib/jitterbug/Task.pm | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/jitterbug/Task.pm b/lib/jitterbug/Task.pm index dd7d1f6..bd949e3 100644 --- a/lib/jitterbug/Task.pm +++ b/lib/jitterbug/Task.pm @@ -5,10 +5,14 @@ use Dancer::Plugin::DBIC; use jitterbug::Plugin::Template; get '/:id' => sub { - my $task = schema->resultset('Task')->find( params->{id} ); + unless ( defined params->{id} ) { + send_error("task id missing!", 400); + return; + } + my $task = schema->resultset('Task')->find( params->{id} ); - if ( !defined $task ) { + unless ( defined $task ) { send_error("task does not exist!", 404); return; } |