From d80cf35e9ba39112bfdefc3ce6ba8ddae121347c Mon Sep 17 00:00:00 2001 From: Ian Walls Date: Wed, 19 Oct 2011 11:46:21 -0400 Subject: [PATCH] Bug 6253 followup: explicitly check ref value for ARRAY before casting in C4::SQLHelper::_Process_Operands, $operand has been modified to be cast as an array ref if the incoming $operand is not a ref. However, the incoming $operand could be some other kind of ref (hashref for example), which would case the dereferencing in line 419 to fail and exit. Adding an explicit test for whether the ref is ARRAY seems to clear up this issue. To test, run t/db_dependent/Members.t. Before, it fails after test 3. After, it completes all tests. Signed-off-by: Chris Cormack --- C4/SQLHelper.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/C4/SQLHelper.pm b/C4/SQLHelper.pm index 720dc998cc..285f7d2b69 100644 --- a/C4/SQLHelper.pm +++ b/C4/SQLHelper.pm @@ -415,7 +415,7 @@ sub _Process_Operands{ my @tmpkeys; my @localkeys; - $operand = [$operand] unless ref $operand; + $operand = [$operand] unless ref $operand eq 'ARRAY'; foreach (@$operand) { push @tmpkeys, " $field = ? "; push @values, $_; -- 2.39.5