From 6a8ee72aab2f0539d082adcd87b88345cdf84dcb Mon Sep 17 00:00:00 2001 From: Ryan Pavlik Date: Wed, 15 Apr 2020 11:19:47 -0500 Subject: [PATCH] glarea: Don't crash on unknown decorator name. --- src/meshlab/glarea.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/meshlab/glarea.cpp b/src/meshlab/glarea.cpp index 56b9aaa3c..e7cffba6d 100644 --- a/src/meshlab/glarea.cpp +++ b/src/meshlab/glarea.cpp @@ -1404,6 +1404,16 @@ void GLArea::updateDecorator(QString name, bool toggle, bool stateToSet) { makeCurrent(); MeshDecorateInterface *iDecorateTemp = this->mw()->PM.getDecoratorInterfaceByName(name); + if (!iDecorateTemp) { + this->Logf(GLLogStream::SYSTEM,"Could not get Decorate interface %s", qUtf8Printable(name)); + this->Logf(GLLogStream::SYSTEM,"Known decorate interfaces:"); + for (auto tt : this->mw()->PM.meshDecoratePlugins()) { + for (auto action : tt->actions()) { + this->Logf(GLLogStream::SYSTEM,"- %s", qUtf8Printable(tt->decorationName(action))); + } + } + return; + } QAction *action = iDecorateTemp->action(name); if(iDecorateTemp->getDecorationClass(action)== MeshDecorateInterface::PerDocument)