minor fix in credit limit
diff --git a/erpnext/selling/doctype/customer/customer.py b/erpnext/selling/doctype/customer/customer.py
index 9e5e7bd..21f6578 100644
--- a/erpnext/selling/doctype/customer/customer.py
+++ b/erpnext/selling/doctype/customer/customer.py
@@ -212,7 +212,7 @@
 			from `tabSales Invoice Item`
 			where dn_detail = %s and docstatus = 1""", dn_item.name)[0][0]
 
-		if flt(dn_item.amount) > flt(si_amount):
+		if flt(dn_item.amount) > flt(si_amount) and dn_item.base_net_total:
 			outstanding_based_on_dn += ((flt(dn_item.amount) - flt(si_amount)) \
 				/ dn_item.base_net_total) * dn_item.base_grand_total