mirror of
https://github.com/fwbuilder/fwbuilder
synced 2026-09-13 16:39:48 +02:00
fixed crash introduced recently
This commit is contained in:
@@ -179,6 +179,10 @@ void FWWindow::openEditor(FWObject *obj)
|
|||||||
//
|
//
|
||||||
FWObject *parent_fw = Host::getParentHost(obj);
|
FWObject *parent_fw = Host::getParentHost(obj);
|
||||||
|
|
||||||
|
if (fwbdebug)
|
||||||
|
qDebug() << "parent firewall:" << parent_fw
|
||||||
|
<< QString((parent_fw)? parent_fw->getName().c_str() : "");
|
||||||
|
|
||||||
if (parent_fw != NULL) // this includes Cluster
|
if (parent_fw != NULL) // this includes Cluster
|
||||||
{
|
{
|
||||||
RuleSetView* rsv = activeProject()->getCurrentRuleSetView();
|
RuleSetView* rsv = activeProject()->getCurrentRuleSetView();
|
||||||
@@ -191,15 +195,16 @@ void FWWindow::openEditor(FWObject *obj)
|
|||||||
md = (RuleSetModel*)rsv->model();
|
md = (RuleSetModel*)rsv->model();
|
||||||
current_ruleset = md->getRuleSet();
|
current_ruleset = md->getRuleSet();
|
||||||
}
|
}
|
||||||
if (obj != current_ruleset->getParent())
|
if (parent_fw != current_ruleset->getParent())
|
||||||
{
|
{
|
||||||
FWObject *old_rs =
|
FWObject *old_rs =
|
||||||
activeProject()->m_panel->om->findRuleSetInHistoryByParentFw(
|
activeProject()->m_panel->om->findRuleSetInHistoryByParentFw(
|
||||||
parent_fw);
|
parent_fw);
|
||||||
|
|
||||||
if (old_rs == NULL)
|
if (old_rs == NULL)
|
||||||
old_rs = obj->getFirstByType(Policy::TYPENAME);
|
old_rs = parent_fw->getFirstByType(Policy::TYPENAME);
|
||||||
|
|
||||||
|
if (old_rs != NULL)
|
||||||
QCoreApplication::postEvent(
|
QCoreApplication::postEvent(
|
||||||
activeProject(), new openRulesetImmediatelyEvent(
|
activeProject(), new openRulesetImmediatelyEvent(
|
||||||
activeProject()->getFileName(), old_rs->getId()));
|
activeProject()->getFileName(), old_rs->getId()));
|
||||||
|
|||||||
Reference in New Issue
Block a user