Skip to content

Commit

Permalink
GenericHollowObject actually returns null when referenced records are…
Browse files Browse the repository at this point in the history
… null
  • Loading branch information
dkoszewnik committed Feb 28, 2017
1 parent 0c416a4 commit 106c9e5
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,12 @@ public final HollowRecord getReferencedGenericRecord(String fieldName) {
return null;
}
}

return GenericHollowRecordHelper.instantiate(getTypeDataAccess().getDataAccess(), referencedType, getOrdinal(fieldName));

int ordinal = getOrdinal(fieldName);
if(ordinal == -1)
return null;

return GenericHollowRecordHelper.instantiate(getTypeDataAccess().getDataAccess(), referencedType, ordinal);
}

@Override
Expand Down

0 comments on commit 106c9e5

Please sign in to comment.