From e10769ff6cce4285a89a50f10ec6cb0268ae3a86 Mon Sep 17 00:00:00 2001 From: Guido Ranzuglia granzuglia Date: Thu, 12 Dec 2013 09:28:59 +0000 Subject: [PATCH] - added null test on currentRaster avoiding plugin to crash when no raster has been loaded --- .../decorate_raster_proj/decorate_raster_proj.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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();