From c718e71417b6f9e11c961dd34f6935427952244e Mon Sep 17 00:00:00 2001 From: Tomas Zigo Date: Tue, 5 Sep 2023 07:48:38 +0200 Subject: [PATCH] m.nviz.image: fix checking if color raster map exists if color_map param arg was used --- misc/m.nviz.image/surface.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/misc/m.nviz.image/surface.c b/misc/m.nviz.image/surface.c index 58f44d3794a..a4b7c836c8f 100644 --- a/misc/m.nviz.image/surface.c +++ b/misc/m.nviz.image/surface.c @@ -99,14 +99,14 @@ int load_rasters(const struct GParams *params, nv_data *data) for (i = 0; i < nsurfs; i++) { id = surf_list[i]; - mapset = G_find_raster2(params->color_map->answers[i], ""); - if (mapset == NULL) { - G_fatal_error(_("Raster map <%s> not found"), - params->color_map->answers[i]); - } /* color */ /* check for color map */ if (i < ncolor_map && strcmp(params->color_map->answers[i], "")) { + mapset = G_find_raster2(params->color_map->answers[i], ""); + if (mapset == NULL) { + G_fatal_error(_("Raster map <%s> not found"), + params->color_map->answers[i]); + } Nviz_set_attr( id, MAP_OBJ_SURF, ATT_COLOR, MAP_ATT, G_fully_qualified_name(params->color_map->answers[i], mapset),