Skip to content

Commit

Permalink
[TD]fix crash on Section apply
Browse files Browse the repository at this point in the history
  • Loading branch information
WandererFan committed Jan 16, 2020
1 parent 05577c2 commit f347765
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions src/Mod/TechDraw/Gui/TaskSectionView.cpp
Expand Up @@ -277,19 +277,23 @@ void TaskSectionView::onApplyClicked(bool b)
bool TaskSectionView::apply(void)
{
// Base::Console().Message("TSV::apply() - m_dirName: %s\n", m_dirName.c_str());
if (m_dirName.empty()) {
std::string msg = Base::Tools::toStdString(tr("TaskSectionView::apply - No section direction picked yet"));
Base::Console().Error((msg + "\n").c_str());
return false;
}
if (m_section == nullptr) {
return false;
}
App::Document* doc = m_section->getDocument();
App::DocumentObject* baseObj = doc->getObject(m_saveBaseName.c_str());
TechDraw::DrawViewPart* dvp = dynamic_cast<TechDraw::DrawViewPart*>(baseObj);
if (dvp == nullptr) {
return false;
}
if (m_dirName.empty()) {
std::string msg = Base::Tools::toStdString(tr("TSV::apply - No section direction picked yet"));
Base::Console().Error((msg + "\n").c_str());
} else {
checkAll(false);
applyQuick(m_dirName);
}

checkAll(false);
applyQuick(m_dirName);
return true;
}

Expand Down

0 comments on commit f347765

Please sign in to comment.