Error - Null value occurred while operation division

Error - Null value occurred while operation division


invoiceID = invoice.get("invoice_id");
invoicedate = invoice.get("date").toDate();
organizationID = organization.get("organization_id");
customerID = invoice.get("customer_id");
invDetails = zoho.books.getRecordsByID("invoices",organizationID,invoiceID).get("invoice");
lineitems = invDetails.get("line_items").toList();
iList = List();
info 'hello';
for each  find in lineitems
{
imap = Map();
itemtotal = find.get("rate").toDecimal();
    <collection>.get(<expression>);
item_custom_fields = find.get("item_custom_fields").toList();
itemcfList = List();
for each  ifs in item_custom_fields
{
itemmap = Map();
lab = ifs.get("label").toString();
val = ifs.get("value");
if(lab == "cf_no_of_bags")
{
a = ifs.get("value").toDecimal();
}
else if(lab == "cf_weight_of_each_bag")
{
b = ifs.get("value").toDecimal();
}
}
C = a * b / 100;
imap.put("quantity",C);
imap.put("line_item_id",find.get("line_item_id"));
iList.add(imap);
}
json = Map();
json.put("customer_id",customerID);
json.put("line_items",iList);
json.put("reason","no reason");
update = zoho.books.updateRecord("invoices",organizationID,invoiceID,json);
info update.get("message");