diff --git a/src/KDA_R.cpp b/src/KDA_R.cpp index 3b945f3..264d3aa 100644 --- a/src/KDA_R.cpp +++ b/src/KDA_R.cpp @@ -35,6 +35,8 @@ void calcLogKDA(std::vector& K, std::vector Phi(MaxA+1,0); //int *Phi = new int[MaxA+1]; for(s=0;s<=MaxA;s++) Phi[s]=0; for (int s = 0; s < SPP; s++) { + if (s >= Abund.size()) throw "s > Abund"; + if (Abund[s] >= Phi.size()) throw "Abund[s] > Phi"; Phi[Abund[s]]++; }