[TD]fix crash on Section apply
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user