while sending the document through API I am getting "Object Reference error not set to instance of an object" error
FileStream file = getTestPdfFile(fileName);
com.echosign.secure.FileInfo[] fileInfos = new com.echosign.secure.FileInfo[1];
fileInfos[0] = new com.echosign.secure.FileInfo();
fileInfos[0].fileName = fileName;
Byte[] bytes = File.ReadAllBytes(".\\" + fileName);
String filed = Convert.ToBase64String(bytes);
byte[] filedata = Convert.FromBase64String(filed);
fileInfos[0].file = filedata;
SenderInfo senderInfo = new SenderInfo();
senderInfo = null;
RecipientInfo[] recipientInfo = new RecipientInfo[2];
RecipientInfo recipientEmail = new RecipientInfo();
recipientEmail.email = recipient;
recipientEmail.fax = null;
recipientEmail.role = RecipientRole.SIGNER;
recipientEmail.roleSpecified = true;
recipientInfo[0] = recipientEmail;
DocumentCreationInfo documentInfo = new DocumentCreationInfo();
documentInfo.recipients = recipientInfo;
documentInfo.name = "Testing Echo";
documentInfo.fileInfos = fileInfos;
documentInfo.signatureType = SignatureType.ESIGN;
documentInfo.signatureFlow = SignatureFlow.SENDER_SIGNATURE_NOT_REQUIRED;
ES.sendDocument(apiKey, senderInfo, documentInfo);
