Skip to content

Commit 1c9302d

Browse files
committed
check targetEntityId.value and targetEntityType.value before use it
1 parent 850ba02 commit 1c9302d

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

lib/services/northBound/contextServer-NGSI-v2.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,12 @@ function handleNotificationNgsi2(req, res, next) {
293293
}
294294
}
295295
logger.debug(context, 'extracted atts %j from dataElement %j', atts, dataElement);
296-
if (dataElement.targetEntityId && dataElement.targetEntityType) {
296+
if (
297+
dataElement.targetEntityId &&
298+
dataElement.targetEntityType &&
299+
dataElement.targetEntityId.value &&
300+
dataElement.targetEntityType.value
301+
) {
297302
deviceService.getDeviceByNameAndType(
298303
dataElement.targetEntityId.value,
299304
dataElement.targetEntityType.value,

0 commit comments

Comments
 (0)