diff --git a/src/cuestionario_respondido/cuestionario_respondido.service.ts b/src/cuestionario_respondido/cuestionario_respondido.service.ts index caa4a81..e7c5c19 100644 --- a/src/cuestionario_respondido/cuestionario_respondido.service.ts +++ b/src/cuestionario_respondido/cuestionario_respondido.service.ts @@ -87,7 +87,9 @@ export class CuestionarioRespondidoService { if (cuestionario.evento?.id_evento) { const id_evento = cuestionario.evento.id_evento; const tieneLista = - await this.eventoUsuarioService.eventoTieneListaRestringida(id_evento); + await this.eventoUsuarioService.eventoTieneListaRestringida( + id_evento, + ); if (tieneLista) { const preguntaIds = submitDto.respuestas.map((r) => r.id_pregunta); @@ -109,13 +111,17 @@ export class CuestionarioRespondidoService { const respuesta = submitDto.respuestas.find( (r) => r.id_pregunta === pregunta.id_pregunta, ); + if ( respuesta && - typeof respuesta.valor === 'string' && - respuesta.valor.trim() + respuesta.valor !== null && + respuesta.valor !== undefined ) { - identificador = respuesta.valor.trim().toUpperCase(); - break; + const valorStr = String(respuesta.valor).trim(); + if (valorStr) { + identificador = valorStr.toUpperCase(); + break; + } } }