Int() argument must be a string or a number, not 'NoneType'

Hi All,
while going for standard SNAPHR I am getting an error i.e " int() argument must be a string or a number, not ‘NoneType’" how to sole this error in line " ctc = int(doc.total_ctc) " please help if any one know how to solve
@frappe.whitelist()
def update_salary_structure_employee(doc,method):
print “in new function update_salary_structure_employee”,doc.salary_structure
ctc = int(doc.total_ctc)
benefits = float(doc.benefit_percentage)
gross1 = float((ctc*benefits)/100)
gross2 = float(ctc-gross1)
gross_salary = gross2/12;
doc.base = gross_salary
frappe.db.sql(“update tabEmployee set base = %s where employee = %s”,(gross_salary,doc.employee))
empdetails = frappe.db.sql(“select name from tabSalary Structure Employee where parent = %s and employee = %s”,(doc.salary_structure,doc.employee));
if not empdetails:

For some reason the var doc.total_ctc is arriving as None (with no data). If this is a normal use case, use flt
from frappe.utils import flt instead of int