mirror of
https://github.com/snipe/snipe-it.git
synced 2024-11-10 07:34:06 -08:00
Add a check to ensure custom fields exist before iterating through them
This commit is contained in:
parent
4715cc6447
commit
8c00bad6d0
|
@ -748,9 +748,11 @@ class ObjectImportCommand extends Command {
|
|||
$asset->purchase_date = NULL;
|
||||
}
|
||||
|
||||
foreach ($item['custom_fields'] as $custom_field => $val) {
|
||||
$asset->{$custom_field} = $val;
|
||||
}
|
||||
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?
|
||||
|
|
Loading…
Reference in a new issue