- added null test on currentRaster avoiding plugin to crash when no raster has been loaded

This commit is contained in:
Guido Ranzuglia granzuglia 2013-12-12 09:28:59 +00:00
parent b7d4ae4351
commit e10769ff6c

View File

@ -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();