Fix crash when adding datum and there's no active body

Plus fix double messageboxes about the lack of the body,
This commit is contained in:
DeepSOIC
2015-05-14 00:18:47 +03:00
committed by Stefan Tröger
parent 5e18faa018
commit da545f3978
5 changed files with 38 additions and 22 deletions

View File

@@ -56,7 +56,7 @@ void CmdPrimtiveCompAdditive::activated(int iMsg)
{
Base::Console().Message("activated msg %i\n", iMsg);
PartDesign::Body *pcActiveBody = PartDesignGui::getBody();
PartDesign::Body *pcActiveBody = PartDesignGui::getBody(/*messageIfNot = */true);
if (!pcActiveBody) return;
if(iMsg == 0) {
@@ -206,4 +206,4 @@ void CreatePartDesignPrimitiveCommands(void)
rcCmdMgr.addCommand(new CmdPrimtiveCompAdditive);
rcCmdMgr.addCommand(new CmdPrimtiveCompSubtractive);
}
}