]> xenbits.xensource.com Git - people/aperard/emesinae.git/commitdiff
bug.pl: Handle lack of id paramter
authorIan Campbell <ian.campbell@citrix.com>
Thu, 23 May 2013 13:37:10 +0000 (14:37 +0100)
committerIan Campbell <ian.campbell@citrix.com>
Thu, 23 May 2013 13:37:29 +0000 (14:37 +0100)
CGI/bug.pl

index af0e02001d738f5e31ea6e8297cbf550e69e15ea..ba0bb6f6a70f705ab0dcb63142c6a523c393aa2f 100755 (executable)
@@ -25,13 +25,24 @@ require 'common.cgi';
 readconfig;
 my $dbh = opendb;
 
-my $bugid = param("id");
-my $bug = Emesinae::Bug->new( $dbh, ID => $bugid );
 
 print header( -charset => 'utf-8', );
 
-if ( !$bug ) {
+my $bugid = param("id");
+if ( !$bugid ) {
+    print start_html(
+        -title => $c{TrackerName} . ": No Bug Number Given",
+        -style => { 'src' => $c{StyleSheet} }
+    );
 
+    print h1("No Bug Number Given");
+    print p( ["Ooops. Bug id paramter missing."] );
+    print end_html;
+    exit(0);
+}
+
+my $bug = Emesinae::Bug->new( $dbh, ID => $bugid );
+if ( !$bug ) {
     print start_html(
         -title => $c{TrackerName} . ": #$bugid - Unknown Bug Number",
         -style => { 'src' => $c{StyleSheet} }