@@ -432,21 +432,26 @@ private static void fetchMap(final ORecordSchemaAware<?> iRootRecord, final Obje
432
432
final Object o = linked .get (key );
433
433
434
434
if (o instanceof OIdentifiable ) {
435
- final ODocument d = ((OIdentifiable ) o ).getRecord ();
436
- if (d != null ) {
437
- // GO RECURSIVELY
438
- final Integer fieldDepthLevel = parsedRecords .get (d .getIdentity ());
439
- if (!d .getIdentity ().isValid () || (fieldDepthLevel != null && fieldDepthLevel .intValue () == iLevelFromRoot )) {
440
- removeParsedFromMap (parsedRecords , d );
441
- iContext .onBeforeDocument (iRootRecord , d , key .toString (), iUserObject );
442
- final Object userObject = iListener .fetchLinkedMapEntry (iRootRecord , iUserObject , fieldName , key .toString (), d ,
443
- iContext );
444
- processRecord (d , userObject , iFetchPlan , iCurrentLevel , iLevelFromRoot , iFieldDepthLevel , parsedRecords ,
445
- iFieldPathFromRoot , iListener , iContext , "" );
446
- iContext .onAfterDocument (iRootRecord , d , key .toString (), iUserObject );
447
- } else {
448
- iListener .parseLinked (iRootRecord , d , iUserObject , key .toString (), iContext );
449
- }
435
+ final ORecordInternal <?> r = ((OIdentifiable ) o ).getRecord ();
436
+ if (r != null ) {
437
+ if (r instanceof ODocument ) {
438
+ // GO RECURSIVELY
439
+ final ODocument d = (ODocument ) r ;
440
+ final Integer fieldDepthLevel = parsedRecords .get (d .getIdentity ());
441
+ if (!d .getIdentity ().isValid () || (fieldDepthLevel != null && fieldDepthLevel .intValue () == iLevelFromRoot )) {
442
+ removeParsedFromMap (parsedRecords , d );
443
+ iContext .onBeforeDocument (iRootRecord , d , key .toString (), iUserObject );
444
+ final Object userObject = iListener .fetchLinkedMapEntry (iRootRecord , iUserObject , fieldName , key .toString (), d ,
445
+ iContext );
446
+ processRecord (d , userObject , iFetchPlan , iCurrentLevel , iLevelFromRoot , iFieldDepthLevel , parsedRecords ,
447
+ iFieldPathFromRoot , iListener , iContext , "" );
448
+ iContext .onAfterDocument (iRootRecord , d , key .toString (), iUserObject );
449
+ } else {
450
+ iListener .parseLinked (iRootRecord , d , iUserObject , key .toString (), iContext );
451
+ }
452
+ } else
453
+ iListener .parseLinked (iRootRecord , r , iUserObject , key .toString (), iContext );
454
+
450
455
}
451
456
} else if (o instanceof Map ) {
452
457
fetchMap (iRootRecord , iUserObject , iFetchPlan , o , key .toString (), iCurrentLevel + 1 , iLevelFromRoot , iFieldDepthLevel ,
0 commit comments