-
- my $q = uri_escape($self->{'q'}, MID_ESC);
- $q =~ s/%20/+/g; # improve URL readability
- my $qs = "q=$q";
-
+ my $qs = '';
+ if (defined(my $q = $self->{'q'})) {
+ $q = uri_escape($q, MID_ESC);
+ $q =~ s/%20/+/g; # improve URL readability
+ $qs .= "q=$q";
+ }