You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This foreach cycle calls $this->importData() without first making sure that the second argument passed ($row) is an array, as typehinted by importData(). Apparently, somethings the reader might return a non-array (null in our case), in which case the whole import fails with the following exception:
ResourceImporter::importData() must be of the type array, null given, called in /var/www/vendor/friendsofsylius/sylius-import-export-plugin/src/Importer/ResourceImporter.php on line 64.
A simple fix is to either check that $row is an array first, or to accept a non-array argument in importData() and trigger an exception there.
I'm thinking it might also be a good idea to catch all throwables there, but that's probably a topic for another discussion.
The text was updated successfully, but these errors were encountered:
This foreach cycle calls
$this->importData()
without first making sure that the second argument passed ($row
) is an array, as typehinted byimportData()
. Apparently, somethings the reader might return a non-array (null
in our case), in which case the whole import fails with the following exception:ResourceImporter::importData() must be of the type array, null given, called in /var/www/vendor/friendsofsylius/sylius-import-export-plugin/src/Importer/ResourceImporter.php on line 64.
A simple fix is to either check that
$row
is an array first, or to accept a non-array argument inimportData()
and trigger an exception there.I'm thinking it might also be a good idea to catch all throwables there, but that's probably a topic for another discussion.
The text was updated successfully, but these errors were encountered: