Skip to content

Commit 211368a

Browse files
committed
oldToNewDescriptionItem - fix bug that returns errors when looking for
values in the input array. Changed to compare explicityly to null.
1 parent 2405349 commit 211368a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

ToolkitApi/CW/cwclasses.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -778,8 +778,9 @@ protected function oldToNewDescriptionItem($oldDataDescription = array(), $input
778778
// Look up its value (could be another data structure or a single value)
779779
// in the input array, based on data structure name.
780780
$dsData = $this->findValueInArray($dsName, $inputValues);
781-
782-
if (!$dsData) {
781+
// Compare with null since this is what findValueInArray returns on error
782+
// this will prevent things such as empty arrays from causing errors
783+
if ($dsData === null) {
783784
// ds has no description to match value!
784785
i5ErrorActivity(I5_ERR_PARAMNOTFOUND, I5_CAT_PHP, "Requested parameter '$dsName' does not exist in the input data", "Requested parameter $dsName does not exist in the input data");
785786
return false;

0 commit comments

Comments
 (0)