summaryrefslogtreecommitdiff
path: root/lib/VNDB/Handler
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2017-03-05 07:38:05 +0100
committerYorhel <git@yorhel.nl>2017-03-05 07:38:05 +0100
commit08a2cf28158b3830d702165d1597db2855b65805 (patch)
treee0c12c84ba520a738fc94edf2d1edf24bf34f5cd /lib/VNDB/Handler
parentb3c72ffdf5e2ebf2916e003084c6a993db985990 (diff)
Fix 500 when editing character entry without traits
Fixes https://vndb.org/t2520.215
Diffstat (limited to 'lib/VNDB/Handler')
-rw-r--r--lib/VNDB/Handler/Chars.pm2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/VNDB/Handler/Chars.pm b/lib/VNDB/Handler/Chars.pm
index ab4a5627..afc467d4 100644
--- a/lib/VNDB/Handler/Chars.pm
+++ b/lib/VNDB/Handler/Chars.pm
@@ -339,7 +339,7 @@ sub edit {
$frm->{desc} = $self->bbSubstLinks($frm->{desc});
$frm->{main_spoil} = 0 if !$frm->{main};
- my %traits = map +($_->{id}, 1), @{$self->dbTraitGet(results => 500, state => 2, id => [ map $_->[0], @traits ])};
+ my %traits = @traits ? map +($_->{id}, 1), @{$self->dbTraitGet(results => 500, state => 2, id => [ map $_->[0], @traits ])} : ();
@traits = grep $traits{$_->[0]}, @traits;
# check for changes