When I run the code, works fine for the first time(array[0]). The problem isn't at the function MatFin.ativos.covariancia. Can somebody help me?
The error:
UnhandledPromiseRejectionWarning: TypeError: Cannot convert undefined or null to object
function matrizDeCovariancia(ativos) {
i = 0
var matrizResultado = new Array
while (i < Object.keys(ativos).length) {
matrizResultado[i] = new Array
a = 0
while (a < Object.keys(ativos).length) {
matrizResultado[i][a] = MatFin.ativos.covariancia(ativos[i], ativos[a])
a++
}
i++
}
return matrizResultado
}