aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStruan Donald <struan@exo.org.uk>2011-06-09 18:26:14 +0100
committerStruan Donald <struan@exo.org.uk>2011-06-09 18:26:14 +0100
commitb5b39afd0d4c6406c491a04f62560a11407e083e (patch)
tree75651cfb82ec537696cebbfb5a7a7f7ad1237ddc
parentaea17c908177ccea8ab65dd1201aba281e958378 (diff)
avoid undefined string in ne warning
-rw-r--r--perllib/FixMyStreet/App/Controller/Admin.pm16
1 files changed, 9 insertions, 7 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Admin.pm b/perllib/FixMyStreet/App/Controller/Admin.pm
index ce9027c32..15aef8cc1 100644
--- a/perllib/FixMyStreet/App/Controller/Admin.pm
+++ b/perllib/FixMyStreet/App/Controller/Admin.pm
@@ -702,13 +702,15 @@ sub update_edit : Path('update_edit') : Args(1) {
my $edited = 0;
- if ( $c->req->param('name') ne $update->name
- || $c->req->param('email') ne $update->user->email
- || $c->req->param('anonymous') ne $update->anonymous
- || $c->req->param('text') ne $update->text )
- {
- $edited = 1;
- }
+ # $update->name can be null which makes ne unhappy
+ my $name = $update->name || '';
+
+ if ( $c->req->param('name') ne $name
+ || $c->req->param('email') ne $update->user->email
+ || $c->req->param('anonymous') ne $update->anonymous
+ || $c->req->param('text') ne $update->text ){
+ $edited = 1;
+ }
if ( $c->req->param('remove_photo') ) {
$update->photo(undef);