fix scan coverity issues

This commit is contained in:
wmayer
2017-04-11 15:06:37 +02:00
parent c526c18b94
commit ba9ffed16b
4 changed files with 24 additions and 15 deletions

View File

@@ -1054,9 +1054,9 @@ void Document::createView(const Base::Type& typeId)
std::list<MDIView*> theViews = this->getMDIViewsOfType(typeId);
if (typeId == View3DInventor::getClassTypeId()) {
View3DInventor* firstView = 0;
View3DInventor* view3D = new View3DInventor(this, getMainWindow());
if (firstView) {
if (!theViews.empty()) {
View3DInventor* firstView = static_cast<View3DInventor*>(theViews.front());
std::string overrideMode = firstView->getViewer()->getOverrideMode();
view3D->getViewer()->setOverrideMode(overrideMode);
}