check customer ledger is null or not before binding

This commit is contained in:
dibakor 2026-07-19 17:35:45 +06:00
parent 777aff085e
commit f02504d76d

View File

@ -331,6 +331,8 @@ public class MobileMasterDataService : IMobileMasterDataService
if (!string.IsNullOrWhiteSpace(request.CustomerCode)) if (!string.IsNullOrWhiteSpace(request.CustomerCode))
{ {
var customerLedger = await _httpService.GetCustomerLedgerAsync(request.CustomerCode, companyCode); var customerLedger = await _httpService.GetCustomerLedgerAsync(request.CustomerCode, companyCode);
if(customerLedger != null)
{
response.Items = response.Items.Select(x => response.Items = response.Items.Select(x =>
{ {
x.CreditBalance = customerLedger.CurrentBalance; x.CreditBalance = customerLedger.CurrentBalance;
@ -339,6 +341,7 @@ public class MobileMasterDataService : IMobileMasterDataService
}).ToList(); }).ToList();
} }
} }
}
catch (Exception ie) catch (Exception ie)
{ {
tc?.HandleError(); tc?.HandleError();