Add a check to ensure custom fields exist before iterating through them

This commit is contained in:
Daniel Meltzer 2016-06-19 23:55:17 -04:00
parent 4715cc6447
commit 8c00bad6d0

View file

@ -748,9 +748,11 @@ class ObjectImportCommand extends Command {
$asset->purchase_date = NULL;
}
if( array_key_exists('custom_fields', $item)) {
foreach ($item['custom_fields'] as $custom_field => $val) {
$asset->{$custom_field} = $val;
}
}
if (!empty($item["purchase_cost"])) {
//TODO How to generalize this for not USD?