aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@mysociety.org>2020-07-06 16:59:28 +0100
committerMatthew Somerville <matthew@mysociety.org>2020-07-07 14:59:57 +0100
commitee42ae7994e80e716a694dedcc30ad85333ef98a (patch)
tree53c38b31b969eaa559591217cec3ac7ce319d614
parentd597f5012f2db5408eb0a913a789bbe2de4d923a (diff)
Make sure string_diff does not return undef.
As string_diff is used in hash values, it must always return something, otherwise you could end up with e.g. category => 'extra'.
-rw-r--r--perllib/FixMyStreet/DB/Result/ModerationOriginalData.pm2
1 files changed, 1 insertions, 1 deletions
diff --git a/perllib/FixMyStreet/DB/Result/ModerationOriginalData.pm b/perllib/FixMyStreet/DB/Result/ModerationOriginalData.pm
index 6d14e6a9f..d2059ab9d 100644
--- a/perllib/FixMyStreet/DB/Result/ModerationOriginalData.pm
+++ b/perllib/FixMyStreet/DB/Result/ModerationOriginalData.pm
@@ -193,7 +193,7 @@ sub string_diff {
$new = FixMyStreet::Template::html_filter($new);
if ($options{single}) {
- return unless $old;
+ return '' unless $old;
$old = [ $old ];
$new = [ $new ];
}