Skip to content

Commit

Permalink
- fix crashes when copying invalid object
Browse files Browse the repository at this point in the history
  • Loading branch information
fbergmann committed Jan 15, 2025
1 parent 99ac944 commit 5223bed
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions copasi/UI/CQCompartment.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,10 @@ void CQCompartment::slotBtnCopy() {}

void CQCompartment::copy()
{

if (!mpObject)
return;

CModel * pModel = mpDataModel->getModel();
CModelExpansion cModelExpObj = CModelExpansion(pModel);
CModelExpansion::SetOfModelElements compartmentObjectsToCopy;
Expand Down
3 changes: 3 additions & 0 deletions copasi/UI/CQEventWidget1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,9 @@ void CQEventWidget1::slotBtnNew()

void CQEventWidget1::slotBtnCopy()
{
if (!mpDataModel || !mpObject)
return;

std::string name = "event";
int i = 1;

Expand Down
3 changes: 3 additions & 0 deletions copasi/UI/CQModelValue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,9 @@ void CQModelValue::slotBtnNew()

void CQModelValue::slotBtnCopy()
{
if (!mpDataModel || !mpObject)
return;

std::string name = "quantity";
int i = 1;

Expand Down

0 comments on commit 5223bed

Please sign in to comment.