fix crash introduced in previous patch
authorGalen Charlton <galen.charlton@liblime.com>
Wed, 15 Jul 2009 02:00:36 +0000 (22:00 -0400)
committerHenri-Damien LAURENT <henridamien.laurent@biblibre.com>
Wed, 16 Sep 2009 21:19:41 +0000 (23:19 +0200)
commit36f9ac9be2c00102ae2cb18a3628f7ea7536184e
tree5771f1ea4dce472d509775aaa59fddee8c012b24
parentf6d2ffa98467e68c04784c0d57368b5e94b1a9dc
fix crash introduced in previous patch

In the previous patch,

-    my @subf = $field->subfields;
-    (defined @subf) or @subf = ();

is not equivalent to

+    my @subf = $field->subfields || ();

as, the results of $field->subields is interpeted in scalar
context, not list context, resutling in @subf containing
the number of subfields, not the subfield data itself, which
engenders the error

Can't use string ("1") as an ARRAY ref while "strict refs" in use

later on.  Changing the operator to 'or' instead of '||'
fixes this.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
cataloguing/additem.pl