mirror of https://github.com/ecmwf/eccodes.git
ECC-804: Return error rather than assert
This commit is contained in:
parent
7e72efada8
commit
0db7a8cdba
|
@ -142,8 +142,10 @@ static int init(grib_iterator* i, grib_handle* h, grib_arguments* args)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
binary_search_gaussian_latitudes(lats, size-1, start, &istart);
|
binary_search_gaussian_latitudes(lats, size-1, start, &istart);
|
||||||
Assert(istart >= 0);
|
if (istart < 0 || istart >= size) {
|
||||||
Assert(istart < size);
|
grib_context_log(h->context, GRIB_LOG_ERROR, "Failed to find index for latitude=%g", start);
|
||||||
|
return GRIB_GEOCALCULUS_PROBLEM;
|
||||||
|
}
|
||||||
|
|
||||||
if (jScansPositively) {
|
if (jScansPositively) {
|
||||||
for (lai = 0; lai < self->Nj; lai++) {
|
for (lai = 0; lai < self->Nj; lai++) {
|
||||||
|
|
Loading…
Reference in New Issue