I have thea lookup relationship.
ifIf I just do the following SOQLquery it works fine:
Sobject c = [select field__r.fieldchild__c from custom_obj where Id = :someId];
system.debug('c:' + c);
However with the above works andfollowing I get the result.
if I do the followingan error:
Sobject c = [select field__r.fieldchild__c from custom_obj where Id = :someId];
String c2 = (String) r.getSobject('field__r').get('fieldchild__c');
then I get the following errorError message:
FATAL_ERROR System.NullPointerException: Attempt to de-reference a null object