diff --git a/src/meshlabplugins/decorate_raster_proj/decorate_raster_proj.cpp b/src/meshlabplugins/decorate_raster_proj/decorate_raster_proj.cpp index e6d74faf5..afa81aa4e 100644 --- a/src/meshlabplugins/decorate_raster_proj/decorate_raster_proj.cpp +++ b/src/meshlabplugins/decorate_raster_proj/decorate_raster_proj.cpp @@ -519,7 +519,7 @@ bool DecorateRasterProjPlugin::initShaders( std::string &logs ) bool DecorateRasterProjPlugin::startDecorate( QAction *act, - MeshDocument & /*m*/, + MeshDocument & m, RichParameterSet * /*par*/, GLArea * /*gla*/ ) { @@ -527,6 +527,11 @@ bool DecorateRasterProjPlugin::startDecorate( QAction *act, { case DP_PROJECT_RASTER: { + if (m.rm() == NULL) + { + qWarning("No valid raster has been loaded."); + return false; + } glPushAttrib( GL_ALL_ATTRIB_BITS ); GLenum err = glewInit();