Undefined Offset: When Migration from M1 to M2

Halts immediately on the following error

Notice: Undefined offset: 4 in /var/www/html/mag_new/vendor/magento/data-migration-tool/src/Migration/Step/Eav/Data.php on line 492

 

Solution: 

Go to vendor/magento/data-migration-tool/src/Migration/Step/Eav/Data.php

in line 490: 

foreach ($customEntityAttributes as $record) {

add this after foreach


if (!isset($this->mapAttributeGroupIdsSourceDest[$record['attribute_group_id']])) {
continue;
}