fix: added validation for incorrect type
diff --git a/erpnext/stock/deprecated_serial_batch.py b/erpnext/stock/deprecated_serial_batch.py
index 0237731..2f1270e 100644
--- a/erpnext/stock/deprecated_serial_batch.py
+++ b/erpnext/stock/deprecated_serial_batch.py
@@ -125,6 +125,9 @@
 			if batch_no not in self.non_batchwise_valuation_batches:
 				continue
 
+			if not self.non_batchwise_balance_qty:
+				continue
+
 			self.batch_avg_rate[batch_no] = (
 				self.non_batchwise_balance_value / self.non_batchwise_balance_qty
 			)