diff --git a/lib/units/device/plugins/service.ts b/lib/units/device/plugins/service.ts index 88ad78ebb..117482651 100644 --- a/lib/units/device/plugins/service.ts +++ b/lib/units/device/plugins/service.ts @@ -373,13 +373,19 @@ export default syrup.serial() if (!response.success) { throw new Error('Unable to get properties') } - const mapped = response.properties.reduce( + + const rawMapped = (response.properties || []).reduce( (acc: any, property: any) => { acc[property.name] = property.value return acc - }, {} + }, + {} ) + const mapped = rawMapped && typeof rawMapped === 'object' + ? rawMapped + : {} + if (mapped.imei) { return mapped }