java.lang.IllegalStateException: FAILED ASSERTION

Hello, i have this error:

java.lang.IllegalStateException: FAILED ASSERTION

And not marked in where point of my program crash, the point is a hugh function with a lot of function inside, and it’s very complicated find the error, anyone knows the reason of this error and how to fix it? thanks for all.

EDIT:

I search inside the function and if i commented this function:

function mustPassControlByDays(oneElement, oneTest, endDate) {
	// Initializing variables
	var ok = true;
	var elemento_a_partir_fecha = oneElement.elemento_a_partir_fecha;
	var ensayo_cada = oneTest.ensayo_cada;
	var proximo_ensayo = getDateNow();

	// Get the last test realized from sheet lines
	var ultima_hoja_lin = lastControlForElement(oneElement, oneTest, "hoja_lin_fecha_plan");

	// if there's no previous control, next test is "+" ensayo_cada. If yes is ensayo_cada plus last date
	if (ultima_hoja_lin) {
		proximo_ensayo.setDate(ultima_hoja_lin.hoja_lin_fecha_plan.getDate() + ensayo_cada);
	} else if (oneElement.elemento_a_partir_fecha) {
		proximo_ensayo.setDate(oneElement.elemento_a_partir_fecha);
	} else {
		proximo_ensayo.setDate(proximo_ensayo.getDate());
	}

	// Is in holidays??
	if (isInHoliday(proximo_ensayo)) {
		proximo_ensayo = calculateHolidays(proximo_ensayo, 1, "+");
	}

	//
	var teorichalDate = proximo_ensayo;

	// If date plan is greather than next test
	if (endDate >= proximo_ensayo) {

		// and if element is after his 'elemento a partir fecha'
		if (elemento_a_partir_fecha != null && elemento_a_partir_fecha > proximo_ensayo) {
			ok = false;
		}
	}

	// return result
	return ok;
}

and this

function mustPassControlByWeeks(oneElement, oneTest, endDate) {
	// Initializing variables
	var ok = true;
	var days = 0;
	var elemento_a_partir_fecha = oneElement.elemento_a_partir_fecha;
	var ensayo_cada = oneTest.ensayo_cada;
	var elemento_dia_semana = oneElement.elemento_dia_semana;
	var nextDay = new Date().getDay();
	var proximo_ensayo = getDateNow();

	// Get the last test realized from sheet lines
	var ultima_hoja_lin = lastControlForElement(oneElement, oneTest, "hoja_lin_fecha_plan");

	if (!elemento_dia_semana && ultima_hoja_lin) {
		elemento_dia_semana = ultima_hoja_lin.hoja_lin_fecha_plan.getDay();
	}

	if (elemento_dia_semana < nextDay) {
		days = nextDay - elemento_dia_semana;
	} else if (elemento_dia_semana > nextDay) {
		days = 7 - nextDay + elemento_dia_semana;
	}

	proximo_ensayo.setDate(proximo_ensayo.getDate() + days)
	var teorichalDate = proximo_ensayo;

	// if there's no previous control, next test is "+" ensayo_cada. If yes is ensayo_cada plus last date
	if (ultima_hoja_lin) {
		proximo_ensayo.setDate(ultima_hoja_lin.hoja_lin_fecha_plan.getDate() + days * 7);
	} else if (oneElement.elemento_a_partir_fecha) {
		proximo_ensayo.setDate(oneElement.elemento_a_partir_fecha);
	}

	// Is in holidays??
	if (isInHoliday(proximo_ensayo)) {
		proximo_ensayo = calculateHolidays(proximo_ensayo, 1, "+");
	}

	// If date plan is greather than next test
	if (endDate >= proximo_ensayo) {

		// and if element is after his 'elemento a partir fecha'
		if (elemento_a_partir_fecha != null && elemento_a_partir_fecha > proximo_ensayo) {
			ok = false;
		}
	}

	// return result
	return ok;
}

not popup the ASSERTION error, this problem i haved a few weeks ago, and was for a date bad setet, but i don’t know ehere is my error, any help?

do you have in the log a full stacktrace?

Hello, I found finally the mistake, in this line:

proximo_ensayo.setDate(oneElement.elemento_a_partir_fecha);

i need to put getDate to elemento_a_partir_fecha, and that’s work fine.