From 09ccb3cd3086e71df7cb77b6d5ea8252167bfc3b Mon Sep 17 00:00:00 2001 From: Tomas Zigo <50632337+tmszi@users.noreply.github.com> Date: Fri, 8 Sep 2023 13:10:54 +0200 Subject: [PATCH] m.nviz.image: fix checking if color raster map exists if color_map param arg was used (#3139) --- 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),